mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 04:22:28 +02:00
remove export global properties
This commit is contained in:
parent
8a4a0c490d
commit
66aac8f5ed
4 changed files with 4 additions and 15 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import type { Middleware } from 'openapi-fetch'
|
||||
import createClient from 'openapi-fetch'
|
||||
import type { paths } from '@/generated/openapi/komga'
|
||||
import { globalProperties } from '@/main'
|
||||
|
||||
// Middleware that throws on error, so it works with Pinia Colada
|
||||
const coladaMiddleware: Middleware = {
|
||||
|
|
@ -22,15 +21,7 @@ const coladaMiddleware: Middleware = {
|
|||
return undefined
|
||||
},
|
||||
onError() {
|
||||
throw new Error('error', {
|
||||
cause: {
|
||||
message: globalProperties.$intl.formatMessage({
|
||||
description: 'Network error: error message when the server cannot be reached',
|
||||
defaultMessage: 'Server is unreachable',
|
||||
id: '/6WuF/',
|
||||
}),
|
||||
},
|
||||
})
|
||||
throw new Error('error', { cause: {} })
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,5 +18,3 @@ const app = createApp(App)
|
|||
registerPlugins(app)
|
||||
|
||||
app.mount('#app')
|
||||
|
||||
export const globalProperties = app.config.globalProperties
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ const { mutate: performLogin, isLoading } = useMutation({
|
|||
else void router.push('/')
|
||||
},
|
||||
onError: (error) => {
|
||||
if ((error.cause as ErrorCause).status === 401)
|
||||
if ((error?.cause as ErrorCause)?.status === 401)
|
||||
loginError.value = intl.formatMessage({
|
||||
description: 'Login screen: error message displayed when login failed',
|
||||
defaultMessage: 'Invalid login or password',
|
||||
|
|
@ -164,7 +164,7 @@ const { mutate: performLogin, isLoading } = useMutation({
|
|||
else
|
||||
messagesStore.messages.push({
|
||||
text:
|
||||
(error.cause as ErrorCause).message || intl.formatMessage(commonMessages.networkError),
|
||||
(error?.cause as ErrorCause)?.message || intl.formatMessage(commonMessages.networkError),
|
||||
})
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ function handleDialogConfirmation(
|
|||
.catch((error) => {
|
||||
messagesStore.messages.push({
|
||||
text:
|
||||
(error.cause as ErrorCause).message || intl.formatMessage(commonMessages.networkError),
|
||||
(error?.cause as ErrorCause)?.message || intl.formatMessage(commonMessages.networkError),
|
||||
})
|
||||
setLoading(false)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue