fix: tsc fixes

This commit is contained in:
Myzel394 2023-02-18 19:39:33 +01:00
parent 63605bf5da
commit a893501154
6 changed files with 8 additions and 7 deletions

View File

@ -60,13 +60,13 @@
"@types/lodash": "^4.14.191", "@types/lodash": "^4.14.191",
"@types/node": "^18.11.18", "@types/node": "^18.11.18",
"@types/openpgp": "^4.4.18", "@types/openpgp": "^4.4.18",
"@types/react-dom": "^18.0.11",
"@types/react-icons": "^3.0.0", "@types/react-icons": "^3.0.0",
"@types/react-router": "^5.1.19", "@types/react-router": "^5.1.19",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"@types/secure-random-password": "^0.2.1", "@types/secure-random-password": "^0.2.1",
"@types/sort-array": "^4.1.0", "@types/sort-array": "^4.1.0",
"@types/ua-parser-js": "^0.7.36", "@types/ua-parser-js": "^0.7.36",
"@types/yup": "^0.32.0",
"@typescript-eslint/eslint-plugin": "^5.40.0", "@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0", "@typescript-eslint/parser": "^5.40.0",
"@vitejs/plugin-react": "^2.1.0", "@vitejs/plugin-react": "^2.1.0",

View File

@ -79,7 +79,7 @@ export default function useMasterPassword(user: User | ServerUser | null): UseMa
decryptUsingMasterPassword, decryptUsingMasterPassword,
decryptUsingPrivateKey, decryptUsingPrivateKey,
logout, logout,
setEncryptionPassword, setEncryptionPassword: setEncryptionPassword as Dispatch<SetStateAction<string | null>>,
_encryptionPassword: encryptionPassword!, _encryptionPassword: encryptionPassword!,
decryptionPasswordHash: fastHashCode(encryptionPassword || "").toString(), decryptionPasswordHash: fastHashCode(encryptionPassword || "").toString(),
} }

View File

@ -25,6 +25,7 @@ export default function AliasTypeIndicator({type}: AliasTypeIndicatorProps): Rea
const {t} = useTranslation() const {t} = useTranslation()
return ( return (
// @ts-ignore
<Tooltip title={t(ALIAS_TYPE_TOOLTIP_MAP[type] as string)} arrow> <Tooltip title={t(ALIAS_TYPE_TOOLTIP_MAP[type] as string)} arrow>
<Box display="flex" justifyContent="center" alignItems="center"> <Box display="flex" justifyContent="center" alignItems="center">
{ALIAS_TYPE_ICON_MAP[type]} {ALIAS_TYPE_ICON_MAP[type]}

View File

@ -6,7 +6,7 @@ import {ExtensionKleckEvent, ExtensionKleckMessageLatestAlias} from "~/extension
export interface UseExtensionHandlerData { export interface UseExtensionHandlerData {
onEnterPassword?: () => void onEnterPassword?: () => void
onRefetchAliases?: () => void onRefetchAliases?: () => void
onLatestAliasChange?: ({latestAliasId}: ExtensionKleckMessageLatestAlias["data"]) => void onLatestAliasChange?: ({latestAlias}: ExtensionKleckMessageLatestAlias["data"]) => void
} }
export default function useExtensionHandler({ export default function useExtensionHandler({

View File

@ -6,9 +6,9 @@ import React, {ReactElement} from "react"
import {useMutation} from "@tanstack/react-query" import {useMutation} from "@tanstack/react-query"
import {ResendEmailLoginCodeResponse, resendEmailLoginCode} from "~/apis" import {resendEmailLoginCode} from "~/apis"
import {MutationStatusSnackbar, TimedButton} from "~/components" import {MutationStatusSnackbar, TimedButton} from "~/components"
import {ServerSettings} from "~/server-types" import {ServerSettings, SimpleDetailResponse} from "~/server-types"
export interface ResendMailButtonProps { export interface ResendMailButtonProps {
email: string email: string
@ -22,7 +22,7 @@ export default function ResendMailButton({
const settings = useLoaderData() as ServerSettings const settings = useLoaderData() as ServerSettings
const {t} = useTranslation() const {t} = useTranslation()
const mutation = useMutation<ResendEmailLoginCodeResponse, AxiosError, void>(() => const mutation = useMutation<SimpleDetailResponse, AxiosError, void>(() =>
resendEmailLoginCode({ resendEmailLoginCode({
email, email,
sameRequestToken, sameRequestToken,

View File

@ -114,7 +114,7 @@ export default function AliasUsersList({users, queryKey, id}: AliasUsersListProp
try { try {
await mutateAsync(values.users) await mutateAsync(values.users)
} catch (error) { } catch (error) {
setErrors(parseFastAPIError(error as AxiosError)) setErrors(parseFastAPIError(error as AxiosError) as any)
} }
}, },
}) })