Skip to content

Commit 5652182

Browse files
Merge pull request Expensify#65422 from bernhardoj/fix/64257-splitted-tx-doesnt-show-immediately
Fix splitted transactions don't show immediately
2 parents 39610da + 21fae8f commit 5652182

2 files changed

Lines changed: 21 additions & 23 deletions

File tree

src/hooks/useAnimatedHighlightStyle/index.ts

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, {useState} from 'react';
2-
import {InteractionManager} from 'react-native';
32
import {Easing, interpolate, interpolateColor, runOnJS, useAnimatedStyle, useSharedValue, withDelay, withSequence, withTiming} from 'react-native-reanimated';
43
import useScreenWrapperTransitionStatus from '@hooks/useScreenWrapperTransitionStatus';
54
import useTheme from '@hooks/useTheme';
@@ -95,27 +94,25 @@ export default function useAnimatedHighlightStyle({
9594
return;
9695
}
9796
setStartHighlight(false);
98-
InteractionManager.runAfterInteractions(() => {
99-
runOnJS(() => {
100-
nonRepeatableProgress.set(
101-
withDelay(
102-
itemEnterDelay,
103-
withTiming(1, {duration: itemEnterDuration, easing: Easing.inOut(Easing.ease)}, (finished) => {
104-
if (!finished) {
105-
return;
106-
}
107-
108-
repeatableProgress.set(
109-
withSequence(
110-
withDelay(highlightStartDelay, withTiming(1, {duration: highlightStartDuration, easing: Easing.inOut(Easing.ease)})),
111-
withDelay(highlightEndDelay, withTiming(0, {duration: highlightEndDuration, easing: Easing.inOut(Easing.ease)})),
112-
),
113-
);
114-
}),
115-
),
116-
);
117-
})();
118-
});
97+
runOnJS(() => {
98+
nonRepeatableProgress.set(
99+
withDelay(
100+
itemEnterDelay,
101+
withTiming(1, {duration: itemEnterDuration, easing: Easing.inOut(Easing.ease)}, (finished) => {
102+
if (!finished) {
103+
return;
104+
}
105+
106+
repeatableProgress.set(
107+
withSequence(
108+
withDelay(highlightStartDelay, withTiming(1, {duration: highlightStartDuration, easing: Easing.inOut(Easing.ease)})),
109+
withDelay(highlightEndDelay, withTiming(0, {duration: highlightEndDuration, easing: Easing.inOut(Easing.ease)})),
110+
),
111+
);
112+
}),
113+
),
114+
);
115+
})();
119116
}, [
120117
didScreenTransitionEnd,
121118
startHighlight,

src/libs/actions/IOU.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11923,8 +11923,9 @@ function saveSplitTransactions(draftTransaction: OnyxEntry<OnyxTypes.Transaction
1192311923
failureData.push(...(onyxData.failureData ?? []));
1192411924
});
1192511925

11926+
// The new expenses are added to Onyx using the SET method. We use SET here as well to ensure the original transaction update isn't delayed.
1192611927
optimisticData.push({
11927-
onyxMethod: Onyx.METHOD.MERGE,
11928+
onyxMethod: Onyx.METHOD.SET,
1192811929
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${originalTransactionID}`,
1192911930
value: {
1193011931
...originalTransaction,

0 commit comments

Comments
 (0)