support opening transaction view dialog in insights explorer page

This commit is contained in:
MaysWind
2026-01-04 01:22:23 +08:00
parent 6634d5b791
commit 2fb509beb2
3 changed files with 57 additions and 7 deletions
+14
View File
@@ -7,6 +7,7 @@ import { useAccountsStore } from './account.ts';
import { useTransactionCategoriesStore } from './transactionCategory.ts';
import { useOverviewStore } from './overview.ts';
import { useStatisticsStore } from './statistics.ts';
import { useExplorersStore } from '@/stores/explorer.ts';
import { useExchangeRatesStore } from './exchangeRates.ts';
import { type BeforeResolveFunction, itemAndIndex, entries, keys } from '@/core/base.ts';
@@ -108,6 +109,7 @@ export const useTransactionsStore = defineStore('transactions', () => {
const transactionCategoriesStore = useTransactionCategoriesStore();
const overviewStore = useOverviewStore();
const statisticsStore = useStatisticsStore();
const explorersStore = useExplorersStore();
const exchangeRatesStore = useExchangeRatesStore();
const transactionDraft = ref<TransactionDraft | null>(getUserTransactionDraft());
@@ -1078,6 +1080,10 @@ export const useTransactionsStore = defineStore('transactions', () => {
statisticsStore.updateTransactionStatisticsInvalidState(true);
}
if (!explorersStore.transactionExplorerStateInvalid) {
explorersStore.updateTransactionExplorerInvalidState(true);
}
resolve(transaction);
}).catch(error => {
logger.error('failed to save transaction', error);
@@ -1127,6 +1133,10 @@ export const useTransactionsStore = defineStore('transactions', () => {
statisticsStore.updateTransactionStatisticsInvalidState(true);
}
if (!explorersStore.transactionExplorerStateInvalid) {
explorersStore.updateTransactionExplorerInvalidState(true);
}
resolve(data.result);
}).catch(error => {
logger.error('failed to move transactions', error);
@@ -1184,6 +1194,10 @@ export const useTransactionsStore = defineStore('transactions', () => {
statisticsStore.updateTransactionStatisticsInvalidState(true);
}
if (!explorersStore.transactionExplorerStateInvalid) {
explorersStore.updateTransactionExplorerInvalidState(true);
}
resolve(data.result);
}).catch(error => {
logger.error('failed to delete transaction', error);