From 3dae18b93cc2a219087c4e1a8acc763ff064b71d Mon Sep 17 00:00:00 2001 From: Johann150 Date: Thu, 26 May 2022 15:53:09 +0200 Subject: fix lints (#8737) * fix: emits use ev instead of e * fix: errors use err instead of e * fix: replace use of data where possible * fix: events use evt instead of e * fix: use strict equals * fix: use emoji instead of e * fix: vue lints --- packages/client/src/ui/_common_/sw-inject.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'packages/client/src/ui/_common_') diff --git a/packages/client/src/ui/_common_/sw-inject.ts b/packages/client/src/ui/_common_/sw-inject.ts index e3e2ddd7e6..371f80ca15 100644 --- a/packages/client/src/ui/_common_/sw-inject.ts +++ b/packages/client/src/ui/_common_/sw-inject.ts @@ -14,30 +14,29 @@ export function swInject() { console.log('sw msg', ev.data); } - const data = ev.data; // as SwMessage - if (data.type !== 'order') return; + if (ev.data.type !== 'order') return; - if (data.loginId !== $i?.id) { - return getAccountFromId(data.loginId).then(account => { + if (ev.data.loginId !== $i?.id) { + return getAccountFromId(ev.data.loginId).then(account => { if (!account) return; - return login(account.token, data.url); + return login(account.token, ev.data.url); }); } - switch (data.order) { + switch (ev.data.order) { case 'post': - return post(data.options); + return post(ev.data.options); case 'push': - if (router.currentRoute.value.path === data.url) { + if (router.currentRoute.value.path === ev.data.url) { return window.scroll({ top: 0, behavior: 'smooth' }); } if (navHook) { - return navHook(data.url); + return navHook(ev.data.url); } - if (sideViewHook && defaultStore.state.defaultSideView && data.url !== '/') { - return sideViewHook(data.url); + if (sideViewHook && defaultStore.state.defaultSideView && ev.data.url !== '/') { + return sideViewHook(ev.data.url); } - return router.push(data.url); + return router.push(ev.data.url); default: return; } -- cgit v1.2.3-freya