From 4b095c4b5cefd5ef08500176f76dd05c48199016 Mon Sep 17 00:00:00 2001 From: FruitRiin Date: Tue, 31 Oct 2023 13:12:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?headerAction=E3=81=ABPC=E4=BB=A5=E5=A4=96?= =?UTF-8?q?=E3=81=A7=E7=A9=BA=E3=81=AE=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=8C?= =?UTF-8?q?=E5=87=BA=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/pages/timeline.vue | 66 +++++++++++++----------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index f601bc8a85..6a472311d8 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -140,36 +140,42 @@ function focus(): void { tlComponent.focus(); } -const headerActions = $computed(() => [ - ...[deviceKind === 'desktop' ? { - icon: 'ti ti-refresh', - text: i18n.ts.reload, - handler: (ev) => { - console.log('called'); - tlComponent.reloadTimeline(); - }, - } : {}], { - icon: 'ti ti-dots', - text: i18n.ts.options, - handler: (ev) => { - os.popupMenu([{ - type: 'switch', - text: i18n.ts.showRenotes, - icon: 'ti ti-repeat', - ref: $$(withRenotes), - }, src === 'local' || src === 'social' ? { - type: 'switch', - text: i18n.ts.showRepliesToOthersInTimeline, - ref: $$(withReplies), - } : undefined, { - type: 'switch', - text: i18n.ts.fileAttachedOnly, - icon: 'ti ti-photo', - ref: $$(onlyFiles), - }], ev.currentTarget ?? ev.target); - }, - } -]); +const headerActions = $computed(() => { + const tmp = [ + { + icon: 'ti ti-dots', + text: i18n.ts.options, + handler: (ev) => { + os.popupMenu([{ + type: 'switch', + text: i18n.ts.showRenotes, + icon: 'ti ti-repeat', + ref: $$(withRenotes), + }, src === 'local' || src === 'social' ? { + type: 'switch', + text: i18n.ts.showRepliesToOthersInTimeline, + ref: $$(withReplies), + } : undefined, { + type: 'switch', + text: i18n.ts.fileAttachedOnly, + icon: 'ti ti-photo', + ref: $$(onlyFiles), + }], ev.currentTarget ?? ev.target); + }, + } + ] + if (deviceKind === "desktop") { + tmp.unshift({ + icon: "ti ti-refresh", + text: i18n.ts.reload, + handler: (ev: Event) => { + console.log("called"); + tlComponent.reloadTimeline(); + }, + }); + } + return tmp +}); const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({ key: 'list:' + l.id, From fbaa2fff89f11810116caf8d26f117cb8dbc5ed5 Mon Sep 17 00:00:00 2001 From: FruitRiin Date: Tue, 31 Oct 2023 13:33:13 +0900 Subject: [PATCH 2/2] fix eslint --- packages/frontend/src/pages/timeline.vue | 68 ++++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index 6a472311d8..5b97385ead 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -141,40 +141,40 @@ function focus(): void { } const headerActions = $computed(() => { - const tmp = [ - { - icon: 'ti ti-dots', - text: i18n.ts.options, - handler: (ev) => { - os.popupMenu([{ - type: 'switch', - text: i18n.ts.showRenotes, - icon: 'ti ti-repeat', - ref: $$(withRenotes), - }, src === 'local' || src === 'social' ? { - type: 'switch', - text: i18n.ts.showRepliesToOthersInTimeline, - ref: $$(withReplies), - } : undefined, { - type: 'switch', - text: i18n.ts.fileAttachedOnly, - icon: 'ti ti-photo', - ref: $$(onlyFiles), - }], ev.currentTarget ?? ev.target); - }, - } - ] - if (deviceKind === "desktop") { - tmp.unshift({ - icon: "ti ti-refresh", - text: i18n.ts.reload, - handler: (ev: Event) => { - console.log("called"); - tlComponent.reloadTimeline(); - }, - }); - } - return tmp + const tmp = [ + { + icon: 'ti ti-dots', + text: i18n.ts.options, + handler: (ev) => { + os.popupMenu([{ + type: 'switch', + text: i18n.ts.showRenotes, + icon: 'ti ti-repeat', + ref: $$(withRenotes), + }, src === 'local' || src === 'social' ? { + type: 'switch', + text: i18n.ts.showRepliesToOthersInTimeline, + ref: $$(withReplies), + } : undefined, { + type: 'switch', + text: i18n.ts.fileAttachedOnly, + icon: 'ti ti-photo', + ref: $$(onlyFiles), + }], ev.currentTarget ?? ev.target); + }, + }, + ]; + if (deviceKind === 'desktop') { + tmp.unshift({ + icon: 'ti ti-refresh', + text: i18n.ts.reload, + handler: (ev: Event) => { + console.log('called'); + tlComponent.reloadTimeline(); + }, + }); + } + return tmp; }); const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({