Performance fixes

This commit is contained in:
wvffle 2022-08-05 14:20:20 +00:00 committed by Georg Krause
parent ad41d90a45
commit 07abe66af1
2 changed files with 2 additions and 10 deletions

View File

@ -44,6 +44,7 @@ export const install: InitModule = ({ store, router }) => {
content: error.response?.data,
class: 'error'
})
break
case 403:
error.backendErrors.push('Permission denied')

View File

@ -31,17 +31,8 @@ export function parseAPIErrors (responseData: APIErrorResponse, parentField?: st
return errors
}
export function getCookie (name: string) {
return document.cookie
.split('; ')
.find(row => row.startsWith(name))
?.split('=')[1]
}
export function getDomain (url: string) {
const parser = document.createElement('a')
parser.href = url
return parser.hostname
return new URL(url).hostname
}
export function arrayMove (arr: unknown[], oldIndex: number, newIndex: number) {