mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 01:04:25 +08:00
code refactor
This commit is contained in:
@@ -210,8 +210,6 @@ import { ThemeType } from '@/core/theme.ts';
|
||||
import { isUserScheduledTransactionEnabled } from '@/lib/server_settings.ts';
|
||||
import { getSystemTheme, setExpenseAndIncomeAmountColor } from '@/lib/ui/common.ts';
|
||||
|
||||
type SnackBarType = InstanceType<typeof SnackBar>;
|
||||
|
||||
import {
|
||||
mdiMenu,
|
||||
mdiHomeOutline,
|
||||
@@ -235,6 +233,8 @@ import {
|
||||
mdiLogout
|
||||
} from '@mdi/js';
|
||||
|
||||
type SnackBarType = InstanceType<typeof SnackBar>;
|
||||
|
||||
const display = useDisplay();
|
||||
const theme = useTheme();
|
||||
const route = useRoute();
|
||||
@@ -277,21 +277,11 @@ const showVerticalOverlayMenu = ref<boolean>(false);
|
||||
const showLoading = ref<boolean>(false);
|
||||
const showMobileQrCode = ref<boolean>(false);
|
||||
|
||||
const mdAndDown = computed<boolean>(() => {
|
||||
return display.mdAndDown.value;
|
||||
});
|
||||
const mdAndDown = computed<boolean>(() => display.mdAndDown.value);
|
||||
const currentRoutePath = computed<string>(() => route.path);
|
||||
|
||||
const currentRoutePath = computed<string>(() => {
|
||||
return route.path;
|
||||
});
|
||||
|
||||
const currentNickName = computed<string>(() => {
|
||||
return userStore.currentUserNickname || tt('User');
|
||||
});
|
||||
|
||||
const currentUserAvatar = computed<string | null>(() => {
|
||||
return userStore.getUserAvatarUrl(userStore.currentUserBasicInfo, true);
|
||||
});
|
||||
const currentNickName = computed<string>(() => userStore.currentUserNickname || tt('User'));
|
||||
const currentUserAvatar = computed<string | null>(() => userStore.getUserAvatarUrl(userStore.currentUserBasicInfo, true));
|
||||
|
||||
const currentTheme = computed<string>({
|
||||
get: () => {
|
||||
@@ -310,9 +300,7 @@ const currentTheme = computed<string>({
|
||||
}
|
||||
});
|
||||
|
||||
const isEnableApplicationLock = computed<boolean>(() => {
|
||||
return settingsStore.appSettings.applicationLock;
|
||||
});
|
||||
const isEnableApplicationLock = computed<boolean>(() => settingsStore.appSettings.applicationLock);
|
||||
|
||||
function handleNavScroll(e: Event): void {
|
||||
isVerticalNavScrolled.value = (e.target as HTMLElement).scrollTop > 0;
|
||||
|
||||
@@ -98,9 +98,7 @@ const pinCode = ref<string>('');
|
||||
const enablingWebAuthn = ref<boolean>(false);
|
||||
const transactionsStore = useTransactionsStore();
|
||||
|
||||
const pinCodeValid = computed<boolean>(() => {
|
||||
return pinCode.value?.length === 6 || false;
|
||||
});
|
||||
const pinCodeValid = computed<boolean>(() => pinCode.value?.length === 6 || false);
|
||||
|
||||
function confirm(): void {
|
||||
if (isEnableApplicationLock.value) {
|
||||
|
||||
@@ -410,9 +410,7 @@ const avatarUrl = ref<string>('');
|
||||
const avatarProvider = ref<string | undefined>('');
|
||||
const avatarNoCacheId = ref<string>('');
|
||||
|
||||
const currentUserAvatar = computed<string | null>(() => {
|
||||
return userStore.getUserAvatarUrl(avatarUrl.value, avatarNoCacheId.value);
|
||||
});
|
||||
const currentUserAvatar = computed<string | null>(() => userStore.getUserAvatarUrl(avatarUrl.value, avatarNoCacheId.value));
|
||||
|
||||
function init(): void {
|
||||
loading.value = true;
|
||||
|
||||
Reference in New Issue
Block a user