fix list
This commit is contained in:
parent
ce93f51d5b
commit
cdaff8d8e0
3 changed files with 19 additions and 17 deletions
|
|
@ -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
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue