Skip to content

Commit ae66f49

Browse files
fix timing
1 parent fb64548 commit ae66f49

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

extensions/react-ui-core/src/useStyleEffectSwipeBack.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,11 @@ export function useStyleEffectSwipeBack({
235235
const v = (x - x0) / (t - t0);
236236
const swiped = v > 1 || x / $paper.clientWidth > 0.4;
237237

238+
onSwipeEnd?.({ swiped });
239+
238240
Promise.resolve()
239241
.then(() => resetPaper({ swiped }))
240-
.then(() => resetState())
241-
.then(() => onSwipeEnd?.({ swiped }));
242+
.then(() => resetState());
242243
};
243244

244245
$edge.addEventListener("touchstart", onTouchStart, { passive: true });

0 commit comments

Comments
 (0)