frontend: normalize auth oauth i18n and error toasts

This commit is contained in:
IanShaw027
2026-04-21 22:26:11 +08:00
parent 4c21320d1b
commit a6b919eb53
25 changed files with 909 additions and 472 deletions

View File

@@ -6,6 +6,7 @@
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
import type { Toast, ToastType, PublicSettings } from '@/types'
import { i18n } from '@/i18n'
import {
checkUpdates as checkUpdatesAPI,
type VersionInfo,
@@ -209,7 +210,10 @@ export const useAppStore = defineStore('app', () => {
try {
return await operation()
} catch (error) {
const message = errorMessage || (error as { message?: string }).message || 'An error occurred'
const message =
errorMessage ||
(error as { message?: string }).message ||
i18n.global.t('common.unknownError')
showError(message)
return null
} finally {