File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
packages/desktop-client/src/hooks Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { useCachedSchedules } from './useCachedSchedules';
23
23
import { type ScheduleStatuses } from './useSchedules' ;
24
24
import { useSyncedPref } from './useSyncedPref' ;
25
25
26
+ import { aqlQuery } from '@desktop-client/queries/aqlQuery' ;
26
27
import { liveQuery } from '@desktop-client/queries/liveQuery' ;
27
28
import {
28
29
pagedQuery ,
@@ -179,14 +180,12 @@ export function useTransactions({
179
180
180
181
useMemo ( ( ) => {
181
182
if ( optionsRef . current . calculateRunningBalances && runningBalanceQuery ) {
182
- liveQuery ( runningBalanceQuery , {
183
- onData : ( data : { id : string ; balance : IntegerAmount } [ ] ) => {
184
- const map = new Map < TransactionEntity [ 'id' ] , IntegerAmount > ( ) ;
185
- data . forEach ( val => {
186
- map . set ( val . id , val . balance ) ;
187
- } ) ;
188
- setRunningBalances ( map ) ;
189
- } ,
183
+ aqlQuery ( runningBalanceQuery ) . then ( data => {
184
+ const map = new Map < TransactionEntity [ 'id' ] , IntegerAmount > ( ) ;
185
+ data . data . forEach ( val => {
186
+ map . set ( val . id , val . balance ) ;
187
+ } ) ;
188
+ setRunningBalances ( map ) ;
190
189
} ) ;
191
190
} else {
192
191
setRunningBalances ( new Map ( ) ) ;
You can’t perform that action at this time.
0 commit comments