Skip to content

Commit

Permalink
fix(router): replace custom back method with window.history.back() to…
Browse files Browse the repository at this point in the history
… fix history navigation
  • Loading branch information
ToastKiste21 committed Sep 17, 2024
1 parent 2d34a37 commit a8ea777
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions frontend/src/plugins/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,15 @@ router.beforeEach(metaGuard);
*/
const backTransition = 'slide-x';

router.back = (): ReturnType<typeof router.back> => {
router.back = () => {
const route = router.currentRoute;

/**
* Play the default page transition but reversed, to play a different effect when going
* to the previous page.
*/
route.value.meta.layout.transition = {
enter: 'slide-x-reverse',
leave: route.value.meta.layout.transition.leave ?? backTransition
};

void router.replace(
isStr(router.options.history.state.back)
? router.options.history.state.back
: '/'
);
window.history.back();
};

/**
Expand Down

0 comments on commit a8ea777

Please sign in to comment.