fix: headerActionにPC以外で空のボタンが出てしまうバグの修正 (#12202)

* headerActionにPC以外で空のボタンが出てしまうバグの修正

* fix eslint
This commit is contained in:
果物リン 2023-10-31 17:26:59 +09:00 committed by GitHub
parent 7c692283ad
commit e2f34e3db6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,15 +140,9 @@ function focus(): void {
tlComponent.focus(); tlComponent.focus();
} }
const headerActions = $computed(() => [ const headerActions = $computed(() => {
...[deviceKind === 'desktop' ? { const tmp = [
icon: 'ti ti-refresh', {
text: i18n.ts.reload,
handler: (ev) => {
console.log('called');
tlComponent.reloadTimeline();
},
} : {}], {
icon: 'ti ti-dots', icon: 'ti ti-dots',
text: i18n.ts.options, text: i18n.ts.options,
handler: (ev) => { handler: (ev) => {
@ -168,8 +162,20 @@ const headerActions = $computed(() => [
ref: $$(onlyFiles), ref: $$(onlyFiles),
}], ev.currentTarget ?? ev.target); }], 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 => ({ const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({
key: 'list:' + l.id, key: 'list:' + l.id,