refactor: don't make API calls directly

This commit is contained in:
Sol Fisher Romanoff 2022-06-18 16:04:18 +03:00
parent 9217ca8476
commit a6136f6cb2
No known key found for this signature in database
GPG key ID: 9D3F2B64F2341B62
8 changed files with 115 additions and 47 deletions

View file

@ -26,8 +26,7 @@ const TimelineMenu = {
},
data () {
return {
isOpen: false,
listTitle: null
isOpen: false
}
},
created () {
@ -60,9 +59,7 @@ const TimelineMenu = {
return '#' + this.$route.params.tag
}
if (route === 'list-timeline') {
this.$store.state.api.backendInteractor.getList({ id: this.$route.params.id })
.then((data) => { this.listTitle = data.title })
return this.listTitle
return this.$store.getters.findListTitle(this.$route.params.id)
}
const i18nkey = timelineNames()[this.$route.name]
return i18nkey ? this.$t(i18nkey) : route