* 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
This commit is contained in:
Johann150 2022-05-26 15:53:09 +02:00 committed by GitHub
parent 9c80403072
commit 3dae18b93c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 255 additions and 257 deletions

View file

@ -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;
}