summaryrefslogtreecommitdiff
path: root/packages/client/src/ui/_common_
diff options
context:
space:
mode:
authorJohann150 <johann.galle@protonmail.com>2022-05-26 15:53:09 +0200
committerGitHub <noreply@github.com>2022-05-26 22:53:09 +0900
commit3dae18b93cc2a219087c4e1a8acc763ff064b71d (patch)
treeee00206569ab940f7e1af154452123567c4d92f8 /packages/client/src/ui/_common_
parentuse http-signature module that supports hs2019 (#8635) (diff)
downloadmisskey-3dae18b93cc2a219087c4e1a8acc763ff064b71d.tar.gz
misskey-3dae18b93cc2a219087c4e1a8acc763ff064b71d.tar.bz2
misskey-3dae18b93cc2a219087c4e1a8acc763ff064b71d.zip
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
Diffstat (limited to 'packages/client/src/ui/_common_')
-rw-r--r--packages/client/src/ui/_common_/sw-inject.ts23
1 files changed, 11 insertions, 12 deletions
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;
}