mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-09 16:53:36 -05:00
Make Typescript happy, testing CI build.
Adjust language names.
This commit is contained in:
parent
17c09baf89
commit
b364fe50f6
7 changed files with 23 additions and 13 deletions
|
@ -118,7 +118,7 @@
|
||||||
"react-virtualized-auto-sizer": "^1.0.5",
|
"react-virtualized-auto-sizer": "^1.0.5",
|
||||||
"react-virtuoso": "^1.10.4",
|
"react-virtuoso": "^1.10.4",
|
||||||
"redux": "^4.1.0",
|
"redux": "^4.1.0",
|
||||||
"revolt-api": "0.5.2-alpha.1",
|
"revolt-api": "0.5.2-alpha.2",
|
||||||
"revolt.js": "5.0.1-alpha.6-patch.2",
|
"revolt.js": "5.0.1-alpha.6-patch.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"sass": "^1.35.1",
|
"sass": "^1.35.1",
|
||||||
|
|
|
@ -93,8 +93,8 @@ export const Languages: { [key in Language]: LanguageEntry } = {
|
||||||
de: { display: "Deutsch", emoji: "🇩🇪", i18n: "de" },
|
de: { display: "Deutsch", emoji: "🇩🇪", i18n: "de" },
|
||||||
el: { display: "Ελληνικά", emoji: "🇬🇷", i18n: "el" },
|
el: { display: "Ελληνικά", emoji: "🇬🇷", i18n: "el" },
|
||||||
es: { display: "Español", emoji: "🇪🇸", i18n: "es" },
|
es: { display: "Español", emoji: "🇪🇸", i18n: "es" },
|
||||||
et: { display: "Eestlane", emoji: "🇪🇪", i18n: "et" },
|
et: { display: "eesti", emoji: "🇪🇪", i18n: "et" },
|
||||||
fi: { display: "Suomi", emoji: "🇫🇮", i18n: "fi" },
|
fi: { display: "suomi", emoji: "🇫🇮", i18n: "fi" },
|
||||||
fil: { display: "Pilipino", emoji: "🇵🇭", i18n: "fil", dayjs: "tl-ph" },
|
fil: { display: "Pilipino", emoji: "🇵🇭", i18n: "fil", dayjs: "tl-ph" },
|
||||||
fr: { display: "Français", emoji: "🇫🇷", i18n: "fr" },
|
fr: { display: "Français", emoji: "🇫🇷", i18n: "fr" },
|
||||||
ga: { display: "Gaeilge", emoji: "🇮🇪", i18n: "ga" },
|
ga: { display: "Gaeilge", emoji: "🇮🇪", i18n: "ga" },
|
||||||
|
|
|
@ -79,16 +79,16 @@ export type Screen =
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pop-overs
|
// Pop-overs
|
||||||
| { id: "image_viewer"; attachment?: Attachment; embed?: EmbedImage }
|
|
||||||
| { id: "modify_account"; field: "username" | "email" | "password" }
|
|
||||||
| { id: "profile"; user_id: string }
|
| { id: "profile"; user_id: string }
|
||||||
| { id: "channel_info"; channel: Channel }
|
|
||||||
| { id: "pending_requests"; users: User[] }
|
|
||||||
| {
|
| {
|
||||||
id: "user_picker";
|
id: "user_picker";
|
||||||
omit?: string[];
|
omit?: string[];
|
||||||
callback: (users: string[]) => Promise<void>;
|
callback: (users: string[]) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
| { id: "image_viewer"; attachment?: Attachment; embed?: EmbedImage }
|
||||||
|
| { id: "channel_info"; channel: Channel }
|
||||||
|
| { id: "pending_requests"; users: User[] }
|
||||||
|
| { id: "modify_account"; field: "username" | "email" | "password" }
|
||||||
| {
|
| {
|
||||||
id: "server_identity";
|
id: "server_identity";
|
||||||
server: Server;
|
server: Server;
|
||||||
|
|
|
@ -26,22 +26,30 @@ export default function Popovers() {
|
||||||
|
|
||||||
switch (screen.id) {
|
switch (screen.id) {
|
||||||
case "profile":
|
case "profile":
|
||||||
|
// @ts-expect-error someone figure this out :)
|
||||||
return <UserProfile {...screen} onClose={onClose} />;
|
return <UserProfile {...screen} onClose={onClose} />;
|
||||||
case "user_picker":
|
case "user_picker":
|
||||||
|
// @ts-expect-error someone figure this out :)
|
||||||
return <UserPicker {...screen} onClose={onClose} />;
|
return <UserPicker {...screen} onClose={onClose} />;
|
||||||
case "image_viewer":
|
case "image_viewer":
|
||||||
return <ImageViewer {...screen} onClose={onClose} />;
|
return <ImageViewer {...screen} onClose={onClose} />;
|
||||||
case "channel_info":
|
case "channel_info":
|
||||||
|
// @ts-expect-error someone figure this out :)
|
||||||
return <ChannelInfo {...screen} onClose={onClose} />;
|
return <ChannelInfo {...screen} onClose={onClose} />;
|
||||||
case "pending_requests":
|
case "pending_requests":
|
||||||
|
// @ts-expect-error someone figure this out :)
|
||||||
return <PendingRequests {...screen} onClose={onClose} />;
|
return <PendingRequests {...screen} onClose={onClose} />;
|
||||||
case "modify_account":
|
case "modify_account":
|
||||||
|
// @ts-expect-error someone figure this out :)
|
||||||
return <ModifyAccountModal onClose={onClose} {...screen} />;
|
return <ModifyAccountModal onClose={onClose} {...screen} />;
|
||||||
case "special_prompt":
|
case "special_prompt":
|
||||||
|
// @ts-expect-error someone figure this out :)
|
||||||
return <SpecialPromptModal onClose={onClose} {...screen} />;
|
return <SpecialPromptModal onClose={onClose} {...screen} />;
|
||||||
case "special_input":
|
case "special_input":
|
||||||
|
// @ts-expect-error someone figure this out :)
|
||||||
return <SpecialInputModal onClose={onClose} {...screen} />;
|
return <SpecialInputModal onClose={onClose} {...screen} />;
|
||||||
case "server_identity":
|
case "server_identity":
|
||||||
|
// @ts-expect-error someone figure this out :)
|
||||||
return <ServerIdentityModal onClose={onClose} {...screen} />;
|
return <ServerIdentityModal onClose={onClose} {...screen} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { Children } from "../../types/Preact";
|
||||||
import { useIntermediate } from "../intermediate/Intermediate";
|
import { useIntermediate } from "../intermediate/Intermediate";
|
||||||
import { registerEvents, setReconnectDisallowed } from "./events";
|
import { registerEvents, setReconnectDisallowed } from "./events";
|
||||||
import { takeError } from "./util";
|
import { takeError } from "./util";
|
||||||
|
import { Session } from "revolt-api/types/Auth";
|
||||||
|
|
||||||
export enum ClientStatus {
|
export enum ClientStatus {
|
||||||
INIT,
|
INIT,
|
||||||
|
@ -79,7 +80,7 @@ function Context({ auth, children }: Props) {
|
||||||
const login = () =>
|
const login = () =>
|
||||||
dispatch({
|
dispatch({
|
||||||
type: "LOGIN",
|
type: "LOGIN",
|
||||||
session: client.session!, // This [null assertion] is ok, we should have a session by now. - insert's words
|
session: client.session as Session,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (onboarding) {
|
if (onboarding) {
|
||||||
|
|
|
@ -32,7 +32,8 @@ interface Session {
|
||||||
|
|
||||||
export function Sessions() {
|
export function Sessions() {
|
||||||
const client = useContext(AppContext);
|
const client = useContext(AppContext);
|
||||||
const deviceId = client.session?.id;
|
const deviceId =
|
||||||
|
typeof client.session === "object" ? client.session.id : undefined;
|
||||||
|
|
||||||
const [sessions, setSessions] = useState<Session[] | undefined>(undefined);
|
const [sessions, setSessions] = useState<Session[] | undefined>(undefined);
|
||||||
const [attemptingDelete, setDelete] = useState<string[]>([]);
|
const [attemptingDelete, setDelete] = useState<string[]>([]);
|
||||||
|
|
|
@ -3639,10 +3639,10 @@ reusify@^1.0.4:
|
||||||
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
|
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
|
||||||
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
|
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
|
||||||
|
|
||||||
revolt-api@0.5.2-alpha.1:
|
revolt-api@0.5.2-alpha.2:
|
||||||
version "0.5.2-alpha.1"
|
version "0.5.2-alpha.2"
|
||||||
resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.2-alpha.1.tgz#2164d04cd5581267ce59142557666bd386bc85c4"
|
resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.2-alpha.2.tgz#a083b918c239d0b8967f8a2c7f10d6466d30d3d5"
|
||||||
integrity sha512-3OrjYCDNPkJ+yO9d87NJvuUDAbungEbUfrfHlvFwV8hJze/RMkuYUTFWe1HyBMwBC7F/yWQK+2V7IoifC5STmw==
|
integrity sha512-Sm6YL7vjyt5fpq1kQCp1OtKdjmaH7lgeWON4YDOycb5Bc1hKc9vgRHS4FhGlie2ilrk9Sox3CdY0tCQ0ENcDSw==
|
||||||
|
|
||||||
revolt.js@5.0.1-alpha.6-patch.2:
|
revolt.js@5.0.1-alpha.6-patch.2:
|
||||||
version "5.0.1-alpha.6-patch.2"
|
version "5.0.1-alpha.6-patch.2"
|
||||||
|
|
Loading…
Reference in a new issue