frontend: normalize auth oauth i18n and error toasts
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user