This commit is contained in:
Henry Jameson 2026-08-31 17:32:31 +03:00
commit cdaff8d8e0
3 changed files with 19 additions and 17 deletions

View file

@ -62,6 +62,23 @@ const TimelineMenu = {
(route === 'bookmark-folder' || route === 'bookmarks') (route === 'bookmark-folder' || route === 'bookmarks')
) )
}, },
timelineName() {
const route = this.$route.name
if (route === 'tag-timeline') {
return '#' + this.$route.params.tag
}
if (route === 'lists-timeline') {
console.log(useListsStore, this.$route.params.id)
return useListsStore().findListTitle(this.$route.params.id)
}
if (route === 'bookmark-folder') {
return useBookmarkFoldersStore().findBookmarkFolderName(
this.$route.params.id,
)
}
const i18nkey = timelineNames(this.bookmarkFolders)[this.$route.name]
return i18nkey ? this.$t(i18nkey) : route
},
...mapState(useInstanceCapabilitiesStore, [ ...mapState(useInstanceCapabilitiesStore, [
'pleromaChatMessagesAvailable', 'pleromaChatMessagesAvailable',
'pleromaBookmarkFoldersAvailable', 'pleromaBookmarkFoldersAvailable',
@ -103,22 +120,6 @@ const TimelineMenu = {
event.stopPropagation() event.stopPropagation()
} }
}, },
timelineName() {
const route = this.$route.name
if (route === 'tag-timeline') {
return '#' + this.$route.params.tag
}
if (route === 'lists-timeline') {
return useListsStore().findListTitle(this.$route.params.id)
}
if (route === 'bookmark-folder') {
return useBookmarkFoldersStore().findBookmarkFolderName(
this.$route.params.id,
)
}
const i18nkey = timelineNames(this.bookmarkFolders)[this.$route.name]
return i18nkey ? this.$t(i18nkey) : route
},
}, },
} }

View file

@ -30,7 +30,7 @@
</template> </template>
<template #trigger> <template #trigger>
<span class="button-unstyled timeline-menu-title"> <span class="button-unstyled timeline-menu-title">
<h1 class="title timeline-title">{{ timelineName() }}</h1> <h1 class="title timeline-title">{{ timelineName }}</h1>
<span> <span>
<FAIcon <FAIcon
size="sm" size="sm"

View file

@ -49,6 +49,7 @@ export const useListsStore = defineStore('lists', {
}, },
setLists(value) { setLists(value) {
this.allLists = value this.allLists = value
this.allListsObject = Object.fromEntries(value.map((list) => [list.id, list]))
}, },
async createList({ title }) { async createList({ title }) {
return await createList({ return await createList({