diff options
| author | Johann150 <johann.galle@protonmail.com> | 2022-05-26 15:53:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-26 22:53:09 +0900 |
| commit | 3dae18b93cc2a219087c4e1a8acc763ff064b71d (patch) | |
| tree | ee00206569ab940f7e1af154452123567c4d92f8 /packages/client/src/ui | |
| parent | use http-signature module that supports hs2019 (#8635) (diff) | |
| download | misskey-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')
| -rw-r--r-- | packages/client/src/ui/_common_/sw-inject.ts | 23 | ||||
| -rw-r--r-- | packages/client/src/ui/classic.widgets.vue | 4 | ||||
| -rw-r--r-- | packages/client/src/ui/deck/deck-store.ts | 4 | ||||
| -rw-r--r-- | packages/client/src/ui/universal.widgets.vue | 6 |
4 files changed, 18 insertions, 19 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; } diff --git a/packages/client/src/ui/classic.widgets.vue b/packages/client/src/ui/classic.widgets.vue index f42f27e926..6f9d18bde5 100644 --- a/packages/client/src/ui/classic.widgets.vue +++ b/packages/client/src/ui/classic.widgets.vue @@ -44,13 +44,13 @@ export default defineComponent({ }, removeWidget(widget) { - this.$store.set('widgets', this.$store.state.widgets.filter(w => w.id != widget.id)); + this.$store.set('widgets', this.$store.state.widgets.filter(w => w.id !== widget.id)); }, updateWidget({ id, data }) { this.$store.set('widgets', this.$store.state.widgets.map(w => w.id === id ? { ...w, - data: data + data, } : w)); }, diff --git a/packages/client/src/ui/deck/deck-store.ts b/packages/client/src/ui/deck/deck-store.ts index c2c9ae540b..c847bf2b43 100644 --- a/packages/client/src/ui/deck/deck-store.ts +++ b/packages/client/src/ui/deck/deck-store.ts @@ -276,14 +276,14 @@ export function setColumnWidgets(id: Column['id'], widgets: ColumnWidget[]) { saveDeck(); } -export function updateColumnWidget(id: Column['id'], widgetId: string, data: any) { +export function updateColumnWidget(id: Column['id'], widgetId: string, WidgetData: any) { const columns = copy(deckStore.state.columns); const columnIndex = deckStore.state.columns.findIndex(c => c.id === id); const column = copy(deckStore.state.columns[columnIndex]); if (column == null) return; column.widgets = column.widgets.map(w => w.id === widgetId ? { ...w, - data: data + data: widgetData, } : w); columns[columnIndex] = column; deckStore.set('columns', columns); diff --git a/packages/client/src/ui/universal.widgets.vue b/packages/client/src/ui/universal.widgets.vue index 2660e80368..a42c085690 100644 --- a/packages/client/src/ui/universal.widgets.vue +++ b/packages/client/src/ui/universal.widgets.vue @@ -14,7 +14,7 @@ import { i18n } from '@/i18n'; import { defaultStore } from '@/store'; const emit = defineEmits<{ - (e: 'mounted', el: Element): void; + (ev: 'mounted', el: Element): void; }>(); let editMode = $ref(false); @@ -32,13 +32,13 @@ function addWidget(widget) { } function removeWidget(widget) { - defaultStore.set('widgets', defaultStore.state.widgets.filter(w => w.id != widget.id)); + defaultStore.set('widgets', defaultStore.state.widgets.filter(w => w.id !== widget.id)); } function updateWidget({ id, data }) { defaultStore.set('widgets', defaultStore.state.widgets.map(w => w.id === id ? { ...w, - data: data + data, } : w)); } |