Skip to content

Commit d436b63

Browse files
authored
Merge pull request Expensify#66722 from Expensify/revert-65422-fix/64257-splitted-tx-doesnt-show-immediately
Revert "Fix splitted transactions don't show immediately"
2 parents b92bf1b + ed5932f commit d436b63

2 files changed

Lines changed: 23 additions & 21 deletions

File tree

src/hooks/useAnimatedHighlightStyle/index.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, {useState} from 'react';
2+
import {InteractionManager} from 'react-native';
23
import {Easing, interpolate, interpolateColor, runOnJS, useAnimatedStyle, useSharedValue, withDelay, withSequence, withTiming} from 'react-native-reanimated';
34
import useScreenWrapperTransitionStatus from '@hooks/useScreenWrapperTransitionStatus';
45
import useTheme from '@hooks/useTheme';
@@ -94,25 +95,27 @@ export default function useAnimatedHighlightStyle({
9495
return;
9596
}
9697
setStartHighlight(false);
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-
})();
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+
});
116119
}, [
117120
didScreenTransitionEnd,
118121
startHighlight,

src/libs/actions/IOU.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11923,9 +11923,8 @@ 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.
1192711926
optimisticData.push({
11928-
onyxMethod: Onyx.METHOD.SET,
11927+
onyxMethod: Onyx.METHOD.MERGE,
1192911928
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${originalTransactionID}`,
1193011929
value: {
1193111930
...originalTransaction,

0 commit comments

Comments
 (0)