commit: ebe095bd769481cc114009e8193494d482f9ff4d
parent 50924aab5c4a5fccde3bcf653f4d9192385e9fc9
Author: Henry Jameson <me@hjkos.com>
Date: Mon, 15 Aug 2022 20:43:38 +0300
fix prod build again + fetch lists (and follow request) on login,
stop fetching on logout, don't start fetching in components
Diffstat:
4 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/src/components/lists/lists.js b/src/components/lists/lists.js
@@ -11,9 +11,6 @@ const Lists = {
ListsCard,
ListsNew
},
- created () {
- this.$store.dispatch('startFetchingLists')
- },
computed: {
lists () {
return this.$store.state.lists.allLists
diff --git a/src/components/lists_menu/lists_menu_content.js b/src/components/lists_menu/lists_menu_content.js
@@ -1,20 +1,11 @@
import { mapState } from 'vuex'
import NavigationEntry from 'src/components/navigation/navigation_entry.vue'
-
-export const getListEntries = state => state.lists.allLists.map(list => ({
- name: 'list-' + list.id,
- routeObject: { name: 'lists-timeline', params: { id: list.id } },
- labelRaw: list.title,
- iconLetter: list.title[0]
-}))
+import { getListEntries } from 'src/components/navigation/filter.js'
export const ListsMenuContent = {
props: [
'showPin'
],
- created () {
- this.$store.dispatch('startFetchingLists')
- },
components: {
NavigationEntry
},
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
@@ -36,9 +36,6 @@ library.add(
const NavPanel = {
props: ['forceExpand'],
created () {
- if (this.currentUser && this.currentUser.locked) {
- this.$store.dispatch('startFetchingFollowRequests')
- }
},
components: {
ListsMenuContent,
diff --git a/src/modules/users.js b/src/modules/users.js
@@ -502,6 +502,7 @@ const users = {
store.dispatch('stopFetchingTimeline', 'friends')
store.commit('setBackendInteractor', backendInteractorService(store.getters.getToken()))
store.dispatch('stopFetchingNotifications')
+ store.dispatch('stopFetchingLists')
store.dispatch('stopFetchingFollowRequests')
store.commit('clearNotifications')
store.commit('resetStatuses')
@@ -556,6 +557,12 @@ const users = {
store.dispatch('startFetchingChats')
}
+ store.dispatch('startFetchingLists')
+
+ if (user.locked) {
+ store.dispatch('startFetchingFollowRequests')
+ }
+
if (store.getters.mergedConfig.useStreamingApi) {
store.dispatch('fetchTimeline', 'friends', { since: null })
store.dispatch('fetchNotifications', { since: null })