1
0

feat: improved types (#2547)

Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2547
Reviewed-by: konrad <k@knt.li>
This commit is contained in:
konrad
2022-11-02 16:06:55 +00:00
63 changed files with 444 additions and 340 deletions

View File

@ -50,14 +50,14 @@ async function authenticateWithCode() {
if (localStorage.getItem('authenticating')) {
return
}
localStorage.setItem('authenticating', true)
localStorage.setItem('authenticating', 'true')
errorMessage.value = ''
if (typeof route.query.error !== 'undefined') {
localStorage.removeItem('authenticating')
errorMessage.value = typeof route.query.message !== 'undefined'
? route.query.message
? route.query.message as string
: t('user.auth.openIdGeneralError')
return
}

View File

@ -130,8 +130,8 @@ async function submit() {
try {
await authStore.register(toRaw(credentials))
} catch (e) {
errorMessage.value = e.message
} catch (e: any) {
errorMessage.value = e?.message
}
}
</script>

View File

@ -23,7 +23,7 @@
<x-button
v-if="!isCropAvatar"
:loading="avatarService.loading || loading"
@click="$refs.avatarUploadInput.click()"
@click="avatarUploadInput.click()"
>
{{ $t('user.settings.avatar.uploadAvatar') }}
</x-button>

View File

@ -41,7 +41,7 @@
<td>{{ tk.id }}</td>
<td>{{ formatDateShort(tk.created) }}</td>
<td class="has-text-right">
<x-button type="secondary" @click="deleteToken(tk)">
<x-button variant="secondary" @click="deleteToken(tk)">
{{ $t('misc.delete') }}
</x-button>
</td>

View File

@ -246,7 +246,7 @@ watch(
const listStore = useListStore()
const defaultList = computed({
get: () => listStore.getListById(settings.value.defaultListId),
get: () => listStore.getListById(settings.value.defaultListId) || undefined,
set(l) {
settings.value.defaultListId = l ? l.id : DEFAULT_LIST_ID
},

View File

@ -79,13 +79,14 @@ import {success} from '@/message'
import {useTitle} from '@/composables/useTitle'
import {useConfigStore} from '@/stores/config'
import type {ITotp} from '@/modelTypes/ITotp'
const {t} = useI18n({useScope: 'global'})
useTitle(() => `${t('user.settings.totp.title')} - ${t('user.settings.title')}`)
const totpService = shallowReactive(new TotpService())
const totp = ref(new TotpModel())
const totp = ref<ITotp>(new TotpModel())
const totpQR = ref('')
const totpEnrolled = ref(false)
const totpConfirmPasscode = ref('')