Skip to content

Commit

Permalink
fix: go back if use hook useRouterClearHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
reyzitwo committed Nov 25, 2023
1 parent 0d466ea commit 2124bd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kokateam/router-vkminiapps",
"version": "0.2.1",
"version": "0.2.2",
"description": "Routing library for VK Mini Apps",
"main": "lib/index.js",
"repository": "https://github.com/kokateam/router-vkminiapps",
Expand Down
6 changes: 6 additions & 0 deletions src/storage/selectors/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ export const useClearHistory = selector<boolean>({
viewsPanels[view] = viewsPanels[view][0];
}

for (let item of old.history) {
if (item.type === "panel" || item.type === "modal") {
window.history.go(-1);
}
}

set(AtomHistory, {
...old,
back_step: 0,
Expand Down

0 comments on commit 2124bd4

Please sign in to comment.