mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 12:39:59 +01:00
Eliminate if-statement (#3564)
This commit is contained in:
parent
e649ec557b
commit
cc06ef23ff
@ -411,15 +411,7 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS]) => void,
|
|||||||
|
|
||||||
// Navigation hook
|
// Navigation hook
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (os.store.state.navHook) {
|
next(os.store.state.navHook && os.store.state.navHook(to) ? false : undefined);
|
||||||
if (os.store.state.navHook(to)) {
|
|
||||||
next(false);
|
|
||||||
} else {
|
|
||||||
next();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
next();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('visibilitychange', () => {
|
document.addEventListener('visibilitychange', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user