Eliminate if-statement (#3564)

This commit is contained in:
Aya Morisawa 2018-12-09 03:45:47 +09:00 committed by GitHub
parent 01f60edb17
commit 17baf8770a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 9 deletions

View File

@ -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', () => {