From 60d0e3df7baac4d8778d2633191acc8adff19db1 Mon Sep 17 00:00:00 2001 From: Hazel K Date: Sun, 6 Oct 2024 12:20:06 -0400 Subject: [PATCH] preserve refresh button on mobile UI --- .../frontend/src/pages/following-feed.vue | 73 ++++++++++--------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/packages/frontend/src/pages/following-feed.vue b/packages/frontend/src/pages/following-feed.vue index a45837ed12..afec94065d 100644 --- a/packages/frontend/src/pages/following-feed.vue +++ b/packages/frontend/src/pages/following-feed.vue @@ -169,40 +169,47 @@ const withUserRenotes = ref(false); const withUserReplies = ref(true); const withOnlyFiles = ref(false); -const headerActions = computed(() => isWideViewport.value ? [ - { - icon: 'ti ti-refresh', - text: i18n.ts.reload, - handler: () => reload(), - } satisfies PageHeaderItem, - { - icon: 'ti ti-dots', - text: i18n.ts.options, - handler: (ev) => { - os.popupMenu([ - { - type: 'switch', - text: i18n.ts.showRenotes, - ref: withUserRenotes, - }, { - type: 'switch', - text: i18n.ts.showRepliesToOthersInTimeline, - ref: withUserReplies, - disabled: withOnlyFiles, - }, - { - type: 'divider', - }, - { - type: 'switch', - text: i18n.ts.fileAttachedOnly, - ref: withOnlyFiles, - disabled: withUserReplies, - }, - ], ev.currentTarget ?? ev.target); +const headerActions = computed(() => { + const actions: PageHeaderItem[] = [ + { + icon: 'ti ti-refresh', + text: i18n.ts.reload, + handler: () => reload(), }, - } satisfies PageHeaderItem, -] : []); + ]; + + if (isWideViewport.value) { + actions.push({ + icon: 'ti ti-dots', + text: i18n.ts.options, + handler: (ev) => { + os.popupMenu([ + { + type: 'switch', + text: i18n.ts.showRenotes, + ref: withUserRenotes, + }, { + type: 'switch', + text: i18n.ts.showRepliesToOthersInTimeline, + ref: withUserReplies, + disabled: withOnlyFiles, + }, + { + type: 'divider', + }, + { + type: 'switch', + text: i18n.ts.fileAttachedOnly, + ref: withOnlyFiles, + disabled: withUserReplies, + }, + ], ev.currentTarget ?? ev.target); + }, + }); + } + + return actions; +}); const headerTabs = computed(() => [ {