fix: optimize types for infra/electron (#3574)

This commit is contained in:
Peng Xiao
2023-08-04 17:23:56 +08:00
committed by GitHub
parent 5795020403
commit 6415f0093b
5 changed files with 57 additions and 54 deletions

View File

@@ -139,7 +139,6 @@ const SetDBLocationContent = ({
if (result?.filePath) {
onConfirmLocation(result.filePath);
} else if (result?.error) {
// @ts-expect-error: result.error is dynamic so the type is unknown
toast(t[result.error]());
}
})().catch(err => {
@@ -273,7 +272,6 @@ export const CreateWorkspaceModal = ({
setStep('set-syncing-mode');
} else if (result.error || result.canceled) {
if (result.error) {
// @ts-expect-error: result.error is dynamic so the type is unknown
toast(t[result.error]());
}
onClose();

View File

@@ -36,7 +36,6 @@ export const ExportPanel: FC<{
await syncBlobsToSqliteDb(workspace);
const result = await window.apis?.dialog.saveDBFileAs(workspaceId);
if (result?.error) {
// @ts-expect-error: result.error is dynamic
toast(t[result.error]());
} else if (!result?.canceled) {
toast(t['Export success']());

View File

@@ -55,7 +55,6 @@ export const StoragePanel: FC<{
if (!result?.error && !result?.canceled) {
toast(t['Move folder success']());
} else if (result?.error) {
// @ts-expect-error: result.error is dynamic
toast(t[result.error]());
}
})