client: use constants for remaining timeouts

This commit is contained in:
Norm 2022-10-04 13:11:26 -04:00
parent 7466f8e224
commit 18c116f3fe
Signed by: norm
GPG key ID: 7123E30E441E80DE
3 changed files with 6 additions and 3 deletions

View file

@ -61,6 +61,7 @@ import * as os from '@/os';
import { login } from '@/account';
import { instance } from '@/instance';
import { i18n } from '@/i18n';
import { MINUTE } from '@/const';
let signing = $ref(false);
let user = $ref(null);
@ -124,7 +125,7 @@ function queryKey() {
type: 'public-key',
transports: ['usb', 'nfc', 'ble', 'internal'],
})),
timeout: 60 * 1000,
timeout: MINUTE,
},
}).catch(() => {
queryingKey = false;

View file

@ -13,6 +13,7 @@ export type Theme = {
import lightTheme from '@/themes/_light.json5';
import darkTheme from '@/themes/_dark.json5';
import { SECOND } from '@/const';
export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X'));
@ -53,7 +54,7 @@ export function applyTheme(theme: Theme, persist = true) {
timeout = window.setTimeout(() => {
document.documentElement.classList.remove('_themeChanging_');
}, 1000);
}, SECOND);
// Deep copy
const _theme = JSON.parse(JSON.stringify(theme));

View file

@ -16,6 +16,7 @@ import { GetFormResultType } from '@/scripts/form';
import MkContainer from '@/components/ui/container.vue';
import { defaultStore } from '@/store';
import { i18n } from '@/i18n';
import { SECOND } from '@/const';
const name = 'memo';
@ -54,7 +55,7 @@ const saveMemo = (): void => {
const onChange = (): void => {
changed.value = true;
window.clearTimeout(timeoutId);
timeoutId = window.setTimeout(saveMemo, 1000);
timeoutId = window.setTimeout(saveMemo, SECOND);
};
watch(() => defaultStore.reactiveState.memo, newText => {