mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-11-27 00:00:23 +00:00
fix(router): don't use replace on every route when going back (#2464)
Some checks failed
Push & Release 🌍 / Automation 🎛️ (push) Failing after 35s
Push & Release 🌍 / ${{ github.event_name == 'push' && 'Unstable 🚀⚠️' || 'Stable 🏷️✅' }} (push) Failing after 33s
Push & Release 🌍 / Deploy 🚀 (push) Has been skipped
Push & Release 🌍 / GitHub CodeQL 🔬 (push) Failing after 33s
Some checks failed
Push & Release 🌍 / Automation 🎛️ (push) Failing after 35s
Push & Release 🌍 / ${{ github.event_name == 'push' && 'Unstable 🚀⚠️' || 'Stable 🏷️✅' }} (push) Failing after 33s
Push & Release 🌍 / Deploy 🚀 (push) Has been skipped
Push & Release 🌍 / GitHub CodeQL 🔬 (push) Failing after 33s
Co-authored-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
parent
43c3d5d1b9
commit
ccb0754ae0
@ -42,7 +42,7 @@ router.beforeEach(metaGuard);
|
|||||||
*/
|
*/
|
||||||
const backTransition = 'slide-x';
|
const backTransition = 'slide-x';
|
||||||
|
|
||||||
router.back = (): ReturnType<typeof router.back> => {
|
router.back = () => {
|
||||||
const route = router.currentRoute;
|
const route = router.currentRoute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,11 +54,13 @@ router.back = (): ReturnType<typeof router.back> => {
|
|||||||
leave: route.value.meta.layout.transition.leave ?? backTransition
|
leave: route.value.meta.layout.transition.leave ?? backTransition
|
||||||
};
|
};
|
||||||
|
|
||||||
void router.replace(
|
const historyState = router.options.history.state;
|
||||||
isStr(router.options.history.state.back)
|
|
||||||
? router.options.history.state.back
|
if (historyState && isStr(historyState.back)) {
|
||||||
: '/'
|
router.go(-1);
|
||||||
);
|
} else {
|
||||||
|
router.replace('/');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user