From 17baf8770ae037b3628d6569f3314a952749c777 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 9 Dec 2018 03:45:47 +0900 Subject: [PATCH] Eliminate if-statement (#3564) --- src/client/app/init.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/client/app/init.ts b/src/client/app/init.ts index b28290152..183ed90ed 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -411,15 +411,7 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS]) => void, // Navigation hook router.beforeEach((to, from, next) => { - if (os.store.state.navHook) { - if (os.store.state.navHook(to)) { - next(false); - } else { - next(); - } - } else { - next(); - } + next(os.store.state.navHook && os.store.state.navHook(to) ? false : undefined); }); document.addEventListener('visibilitychange', () => {