diff --git a/package.json b/package.json index 5912596d..5e2bc83e 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "react-virtualized-auto-sizer": "^1.0.5", "react-virtuoso": "^1.10.4", "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", "rimraf": "^3.0.2", "sass": "^1.35.1", diff --git a/src/context/Locale.tsx b/src/context/Locale.tsx index 199d49e5..da039a64 100644 --- a/src/context/Locale.tsx +++ b/src/context/Locale.tsx @@ -93,8 +93,8 @@ export const Languages: { [key in Language]: LanguageEntry } = { de: { display: "Deutsch", emoji: "🇩🇪", i18n: "de" }, el: { display: "Ελληνικά", emoji: "🇬🇷", i18n: "el" }, es: { display: "Español", emoji: "🇪🇸", i18n: "es" }, - et: { display: "Eestlane", emoji: "🇪🇪", i18n: "et" }, - fi: { display: "Suomi", emoji: "🇫🇮", i18n: "fi" }, + et: { display: "eesti", emoji: "🇪🇪", i18n: "et" }, + fi: { display: "suomi", emoji: "🇫🇮", i18n: "fi" }, fil: { display: "Pilipino", emoji: "🇵🇭", i18n: "fil", dayjs: "tl-ph" }, fr: { display: "Français", emoji: "🇫🇷", i18n: "fr" }, ga: { display: "Gaeilge", emoji: "🇮🇪", i18n: "ga" }, diff --git a/src/context/intermediate/Intermediate.tsx b/src/context/intermediate/Intermediate.tsx index 59a3cc1c..e6a3eb49 100644 --- a/src/context/intermediate/Intermediate.tsx +++ b/src/context/intermediate/Intermediate.tsx @@ -79,16 +79,16 @@ export type Screen = } // Pop-overs - | { id: "image_viewer"; attachment?: Attachment; embed?: EmbedImage } - | { id: "modify_account"; field: "username" | "email" | "password" } | { id: "profile"; user_id: string } - | { id: "channel_info"; channel: Channel } - | { id: "pending_requests"; users: User[] } | { id: "user_picker"; omit?: string[]; callback: (users: string[]) => Promise; } + | { 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"; server: Server; diff --git a/src/context/intermediate/Popovers.tsx b/src/context/intermediate/Popovers.tsx index 199dc349..0834a1f8 100644 --- a/src/context/intermediate/Popovers.tsx +++ b/src/context/intermediate/Popovers.tsx @@ -26,22 +26,30 @@ export default function Popovers() { switch (screen.id) { case "profile": + // @ts-expect-error someone figure this out :) return ; case "user_picker": + // @ts-expect-error someone figure this out :) return ; case "image_viewer": return ; case "channel_info": + // @ts-expect-error someone figure this out :) return ; case "pending_requests": + // @ts-expect-error someone figure this out :) return ; case "modify_account": + // @ts-expect-error someone figure this out :) return ; case "special_prompt": + // @ts-expect-error someone figure this out :) return ; case "special_input": + // @ts-expect-error someone figure this out :) return ; case "server_identity": + // @ts-expect-error someone figure this out :) return ; } diff --git a/src/context/revoltjs/RevoltClient.tsx b/src/context/revoltjs/RevoltClient.tsx index 5e6efcef..17f2dc90 100644 --- a/src/context/revoltjs/RevoltClient.tsx +++ b/src/context/revoltjs/RevoltClient.tsx @@ -15,6 +15,7 @@ import { Children } from "../../types/Preact"; import { useIntermediate } from "../intermediate/Intermediate"; import { registerEvents, setReconnectDisallowed } from "./events"; import { takeError } from "./util"; +import { Session } from "revolt-api/types/Auth"; export enum ClientStatus { INIT, @@ -79,7 +80,7 @@ function Context({ auth, children }: Props) { const login = () => dispatch({ 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) { diff --git a/src/pages/settings/panes/Sessions.tsx b/src/pages/settings/panes/Sessions.tsx index c8021c48..877605d4 100644 --- a/src/pages/settings/panes/Sessions.tsx +++ b/src/pages/settings/panes/Sessions.tsx @@ -32,7 +32,8 @@ interface Session { export function Sessions() { const client = useContext(AppContext); - const deviceId = client.session?.id; + const deviceId = + typeof client.session === "object" ? client.session.id : undefined; const [sessions, setSessions] = useState(undefined); const [attemptingDelete, setDelete] = useState([]); diff --git a/yarn.lock b/yarn.lock index 64d96793..227e4e0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3639,10 +3639,10 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -revolt-api@0.5.2-alpha.1: - version "0.5.2-alpha.1" - resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.2-alpha.1.tgz#2164d04cd5581267ce59142557666bd386bc85c4" - integrity sha512-3OrjYCDNPkJ+yO9d87NJvuUDAbungEbUfrfHlvFwV8hJze/RMkuYUTFWe1HyBMwBC7F/yWQK+2V7IoifC5STmw== +revolt-api@0.5.2-alpha.2: + version "0.5.2-alpha.2" + resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.2-alpha.2.tgz#a083b918c239d0b8967f8a2c7f10d6466d30d3d5" + integrity sha512-Sm6YL7vjyt5fpq1kQCp1OtKdjmaH7lgeWON4YDOycb5Bc1hKc9vgRHS4FhGlie2ilrk9Sox3CdY0tCQ0ENcDSw== revolt.js@5.0.1-alpha.6-patch.2: version "5.0.1-alpha.6-patch.2"