Lists implementation: make route naming consistent

This commit is contained in:
Alexander Tumin 2022-08-06 21:39:08 +03:00
parent b5eba5974c
commit 891fbf996d
7 changed files with 9 additions and 9 deletions

View File

@ -77,8 +77,8 @@ export default (store) => {
{ name: 'about', path: '/about', component: About }, { name: 'about', path: '/about', component: About },
{ name: 'user-profile', path: '/:_(users)?/:name', component: UserProfile }, { name: 'user-profile', path: '/:_(users)?/:name', component: UserProfile },
{ name: 'lists', path: '/lists', component: Lists }, { name: 'lists', path: '/lists', component: Lists },
{ name: 'list-timeline', path: '/lists/:id', component: ListsTimeline }, { name: 'lists-timeline', path: '/lists/:id', component: ListsTimeline },
{ name: 'list-edit', path: '/lists/:id/edit', component: ListsEdit } { name: 'lists-edit', path: '/lists/:id/edit', component: ListsEdit }
] ]
if (store.state.instance.pleromaChatMessagesAvailable) { if (store.state.instance.pleromaChatMessagesAvailable) {

View File

@ -1,13 +1,13 @@
<template> <template>
<div class="list-card"> <div class="list-card">
<router-link <router-link
:to="{ name: 'list-timeline', params: { id: list.id } }" :to="{ name: 'lists-timeline', params: { id: list.id } }"
class="list-name" class="list-name"
> >
{{ list.title }} {{ list.title }}
</router-link> </router-link>
<router-link <router-link
:to="{ name: 'list-edit', params: { id: list.id } }" :to="{ name: 'lists-edit', params: { id: list.id } }"
class="button-list-edit" class="button-list-edit"
> >
<FAIcon <FAIcon

View File

@ -79,7 +79,7 @@ const ListsNew = {
this.$store.dispatch('setList', { id: this.id, title: this.title }) this.$store.dispatch('setList', { id: this.id, title: this.title })
this.$store.dispatch('setListAccounts', { id: this.id, accountIds: this.selectedUserIds }) this.$store.dispatch('setListAccounts', { id: this.id, accountIds: this.selectedUserIds })
this.$router.push({ name: 'list-timeline', params: { id: this.id } }) this.$router.push({ name: 'lists-timeline', params: { id: this.id } })
}, },
deleteList () { deleteList () {
this.$store.dispatch('deleteList', { id: this.id }) this.$store.dispatch('deleteList', { id: this.id })

View File

@ -6,7 +6,7 @@
> >
<router-link <router-link
class="menu-item" class="menu-item"
:to="{ name: 'list-timeline', params: { id: list.id } }" :to="{ name: 'lists-timeline', params: { id: list.id } }"
> >
{{ list.title }} {{ list.title }}
</router-link> </router-link>

View File

@ -70,7 +70,7 @@ const ListsNew = {
this.$store.dispatch('createList', { title: this.title }) this.$store.dispatch('createList', { title: this.title })
.then((list) => { .then((list) => {
this.$store.dispatch('setListAccounts', { id: list.id, accountIds: this.selectedUserIds }) this.$store.dispatch('setListAccounts', { id: list.id, accountIds: this.selectedUserIds })
this.$router.push({ name: 'list-timeline', params: { id: list.id } }) this.$router.push({ name: 'lists-timeline', params: { id: list.id } })
}) })
} }
} }

View File

@ -13,7 +13,7 @@ const ListsTimeline = {
}, },
watch: { watch: {
$route: function (route) { $route: function (route) {
if (route.name === 'list-timeline' && route.params.id !== this.listId) { if (route.name === 'lists-timeline' && route.params.id !== this.listId) {
this.listId = route.params.id this.listId = route.params.id
this.$store.dispatch('stopFetchingTimeline', 'list') this.$store.dispatch('stopFetchingTimeline', 'list')
this.$store.commit('clearTimeline', { timeline: 'list' }) this.$store.commit('clearTimeline', { timeline: 'list' })

View File

@ -58,7 +58,7 @@ const TimelineMenu = {
if (route === 'tag-timeline') { if (route === 'tag-timeline') {
return '#' + this.$route.params.tag return '#' + this.$route.params.tag
} }
if (route === 'list-timeline') { if (route === 'lists-timeline') {
return this.$store.getters.findListTitle(this.$route.params.id) return this.$store.getters.findListTitle(this.$route.params.id)
} }
const i18nkey = timelineNames()[this.$route.name] const i18nkey = timelineNames()[this.$route.name]