diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 7f33c46e2..4fd6d87e2 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -289,7 +289,7 @@ export function inputText(props: { }, }, { done: result => { - resolve(result ? result : { canceled: true }); + resolve(typeof result.result === 'string' ? result : { canceled: true, result: undefined }); }, }, 'closed'); }); diff --git a/packages/frontend/src/pages/settings/preferences-backups.vue b/packages/frontend/src/pages/settings/preferences-backups.vue index aa226f671..34372572d 100644 --- a/packages/frontend/src/pages/settings/preferences-backups.vue +++ b/packages/frontend/src/pages/settings/preferences-backups.vue @@ -278,7 +278,7 @@ async function applyProfile(id: string): Promise { const { canceled: cancel1 } = await os.confirm({ type: 'warning', title: ts._preferencesBackups.apply, - text: t('_preferencesBackups.applyConfirm', { name: profile.name }), + text: t('_preferencesBackups.applyConfirm', { name: profile.name || '' }), }); if (cancel1) return; @@ -336,7 +336,7 @@ async function deleteProfile(id: string): Promise { const { canceled } = await os.confirm({ type: 'info', title: ts.delete, - text: t('deleteAreYouSure', { x: profiles.value[id].name }), + text: t('deleteAreYouSure', { x: profiles.value[id].name || '' }), }); if (canceled) return; @@ -352,7 +352,7 @@ async function save(id: string): Promise { const { canceled } = await os.confirm({ type: 'info', title: ts._preferencesBackups.save, - text: t('_preferencesBackups.saveConfirm', { name }), + text: t('_preferencesBackups.saveConfirm', { name: name || '' }), }); if (canceled) return; @@ -387,7 +387,7 @@ async function rename(id: string): Promise { const { canceled: cancel2 } = await os.confirm({ type: 'info', title: ts.rename, - text: t('_preferencesBackups.renameConfirm', { old: registry.name, new: name }), + text: t('_preferencesBackups.renameConfirm', { old: registry.name || '', new: name }), }); if (cancel2) return;