Skip to content

Commit

Permalink
fix cancelable
Browse files Browse the repository at this point in the history
  • Loading branch information
codehz committed Apr 29, 2024
1 parent 358514e commit 23d02d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions router/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ if (typeof history !== "undefined") {
detail: payload,
cancelable: true,
});
let canceled = false;
let ok = true;
unstable_batchedUpdates(() => {
canceled = dispatchEvent(before);
ok = dispatchEvent(before);
});
if (canceled) return;
if (!ok) return;
const result = original.call(this, payload.data, unused, payload.url);
const event = new CustomEvent(type);
unstable_batchedUpdates(() => {
Expand Down

0 comments on commit 23d02d4

Please sign in to comment.