From 9bbe4d2dcf27144a82ba56e618c9e022009a7ae2 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 12 Jan 2025 01:04:19 +0800 Subject: [PATCH] code refactor --- src/components/mobile/TransactionTagSelectionSheet.vue | 2 +- src/views/desktop/tags/ListPage.vue | 8 ++++---- src/views/mobile/tags/ListPage.vue | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/mobile/TransactionTagSelectionSheet.vue b/src/components/mobile/TransactionTagSelectionSheet.vue index ba4933dc..7b2ec20f 100644 --- a/src/components/mobile/TransactionTagSelectionSheet.vue +++ b/src/components/mobile/TransactionTagSelectionSheet.vue @@ -105,7 +105,7 @@ const transactionTagsStore = useTransactionTagsStore(); const selectedItemIds = ref(copyArrayTo(props.modelValue, [])); const newTag = ref(null); -const allTags = computed(() => transactionTagsStore.allTransactionTags); +const allTags = computed(() => transactionTagsStore.allTransactionTags); const noAvailableTag = computed(() => { if (transactionTagsStore.allTransactionTags) { diff --git a/src/views/desktop/tags/ListPage.vue b/src/views/desktop/tags/ListPage.vue index 6b01fc03..b4294a7d 100644 --- a/src/views/desktop/tags/ListPage.vue +++ b/src/views/desktop/tags/ListPage.vue @@ -287,10 +287,10 @@ const transactionTagsStore = useTransactionTagsStore(); const confirmDialog = useTemplateRef('confirmDialog'); const snackbar = useTemplateRef('snackbar'); -const tags = computed(() => transactionTagsStore.allTransactionTags); -const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value)); -const availableTagCount = computed(() => getAvailableTagCount(tags.value, showHidden.value)); -const hasEditingTag = computed(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== ''))); +const tags = computed(() => transactionTagsStore.allTransactionTags); +const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value)); +const availableTagCount = computed(() => getAvailableTagCount(tags.value, showHidden.value)); +const hasEditingTag = computed(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== ''))); function isTagModified(tag: TransactionTag): boolean { if (tag.id) { diff --git a/src/views/mobile/tags/ListPage.vue b/src/views/mobile/tags/ListPage.vue index dcee9e39..11dda40b 100644 --- a/src/views/mobile/tags/ListPage.vue +++ b/src/views/mobile/tags/ListPage.vue @@ -181,11 +181,11 @@ const { showToast, routeBackOnError } = useI18nUIComponents(); const transactionTagsStore = useTransactionTagsStore(); -const tags = computed(() => transactionTagsStore.allTransactionTags); -const firstShowingId = computed(() => getFirstShowingId(tags.value, showHidden.value)); -const lastShowingId = computed(() => getLastShowingId(tags.value, showHidden.value)); -const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value)); -const hasEditingTag = computed(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== ''))); +const tags = computed(() => transactionTagsStore.allTransactionTags); +const firstShowingId = computed(() => getFirstShowingId(tags.value, showHidden.value)); +const lastShowingId = computed(() => getLastShowingId(tags.value, showHidden.value)); +const noAvailableTag = computed(() => isNoAvailableTag(tags.value, showHidden.value)); +const hasEditingTag = computed(() => !!(newTag.value || (editingTag.value.id && editingTag.value.id !== ''))); function isTagModified(tag: TransactionTag): boolean { if (tag.id) {