preserve refresh button on mobile UI

This commit is contained in:
Hazel K 2024-10-06 12:20:06 -04:00
parent 01fb606fee
commit 60d0e3df7b

View file

@ -169,40 +169,47 @@ const withUserRenotes = ref(false);
const withUserReplies = ref(true); const withUserReplies = ref(true);
const withOnlyFiles = ref(false); const withOnlyFiles = ref(false);
const headerActions = computed(() => isWideViewport.value ? [ const headerActions = computed(() => {
{ const actions: PageHeaderItem[] = [
icon: 'ti ti-refresh', {
text: i18n.ts.reload, icon: 'ti ti-refresh',
handler: () => reload(), text: i18n.ts.reload,
} satisfies PageHeaderItem, handler: () => reload(),
{
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);
}, },
} 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(() => [ const headerTabs = computed(() => [
{ {