A local-first personal finance app
Fix transactions table payee schedule icon not showing if linked schedule has a different account configured (#6561)
Joel Jeremy Marquez914074d4b66b
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.tsx b/packages/desktop-client/src/components/transactions/TransactionsTable.tsxindex ef02822dee..ef6b32f8ab 100644--- a/packages/desktop-client/src/components/transactions/TransactionsTable.tsx+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.tsx@@ -44,6 +44,7 @@ import { View } from '@actual-app/components/view';import { format as formatDate, parseISO } from 'date-fns';import * as monthUtils from 'loot-core/shared/months';+import { q } from 'loot-core/shared/query';import { getStatusLabel } from 'loot-core/shared/schedules';import {addSplitTransaction,@@ -110,7 +111,10 @@ import {UnexposedCellContent,useTableNavigator,} from '@desktop-client/components/table';-import { useCachedSchedules } from '@desktop-client/hooks/useCachedSchedules';+import {+ SchedulesProvider,+ useCachedSchedules,+} from '@desktop-client/hooks/useCachedSchedules';import { useContextMenu } from '@desktop-client/hooks/useContextMenu';import {DisplayPayeeProvider,@@ -2986,43 +2990,47 @@ export const TransactionTable = forwardRef([props.transactions, newTransactions],);+ const allSchedulesQuery = useMemo(() => q('schedules').select('*'), []);+return (<DisplayPayeeProvider transactions={displayPayeeTransactions}>- <TransactionTableInner- tableRef={mergedRef}- listContainerRef={listContainerRef}- {...props}- transactions={transactionsWithExpandedSplits}- transactionMap={transactionMap}- transactionsByParent={transactionsByParent}- transferAccountsByTransaction={transferAccountsByTransaction}- selectedItems={selectedItems}- isExpanded={splitsExpanded.isExpanded}- onSave={onSave}- onDelete={onDelete}- onBatchDelete={onBatchDelete}- onBatchDuplicate={onBatchDuplicate}- onBatchLinkSchedule={onBatchLinkSchedule}- onBatchUnlinkSchedule={onBatchUnlinkSchedule}- onCreateRule={onCreateRule}- onScheduleAction={onScheduleAction}- onMakeAsNonSplitTransactions={onMakeAsNonSplitTransactions}- onSplit={onSplit}- onCheckNewEnter={onCheckNewEnter}- onCheckEnter={onCheckEnter}- onAddTemporary={onAddTemporary}- onAddAndCloseTemporary={onAddAndCloseTemporary}- onAddSplit={onAddSplit}- onDistributeRemainder={onDistributeRemainder}- onCloseAddTransaction={onCloseAddTransaction}- onToggleSplit={onToggleSplit}- newTransactions={newTransactions ?? []}- tableNavigator={tableNavigator}- newNavigator={newNavigator}- showSelection={props.showSelection}- allowSplitTransaction={props.allowSplitTransaction}- showHiddenCategories={showHiddenCategories}- />+ <SchedulesProvider query={allSchedulesQuery}>+ <TransactionTableInner+ tableRef={mergedRef}+ listContainerRef={listContainerRef}+ {...props}+ transactions={transactionsWithExpandedSplits}+ transactionMap={transactionMap}+ transactionsByParent={transactionsByParent}+ transferAccountsByTransaction={transferAccountsByTransaction}+ selectedItems={selectedItems}+ isExpanded={splitsExpanded.isExpanded}+ onSave={onSave}+ onDelete={onDelete}+ onBatchDelete={onBatchDelete}+ onBatchDuplicate={onBatchDuplicate}+ onBatchLinkSchedule={onBatchLinkSchedule}+ onBatchUnlinkSchedule={onBatchUnlinkSchedule}+ onCreateRule={onCreateRule}+ onScheduleAction={onScheduleAction}+ onMakeAsNonSplitTransactions={onMakeAsNonSplitTransactions}+ onSplit={onSplit}+ onCheckNewEnter={onCheckNewEnter}+ onCheckEnter={onCheckEnter}+ onAddTemporary={onAddTemporary}+ onAddAndCloseTemporary={onAddAndCloseTemporary}+ onAddSplit={onAddSplit}+ onDistributeRemainder={onDistributeRemainder}+ onCloseAddTransaction={onCloseAddTransaction}+ onToggleSplit={onToggleSplit}+ newTransactions={newTransactions ?? []}+ tableNavigator={tableNavigator}+ newNavigator={newNavigator}+ showSelection={props.showSelection}+ allowSplitTransaction={props.allowSplitTransaction}+ showHiddenCategories={showHiddenCategories}+ />+ </SchedulesProvider></DisplayPayeeProvider>);},diff --git a/upcoming-release-notes/6561.md b/upcoming-release-notes/6561.mdnew file mode 100644index 0000000000..009f56790b--- /dev/null+++ b/upcoming-release-notes/6561.md@@ -0,0 +1,6 @@+---+category: Bugfix+authors: [joel-jeremy]+---++Fix transactions table payee schedule icon not showing if linked schedule has a different account configured