From 8d3d8fffab0106a8aff5822044a8c3c30bd6e057 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 12 Aug 2022 01:19:19 +0300 Subject: fixes, clear cache on logout --- src/modules/users.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/modules/users.js') diff --git a/src/modules/users.js b/src/modules/users.js index b6fb9746..fe92d697 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -509,6 +509,7 @@ const users = { store.dispatch('setLastTimeline', 'public-timeline') store.dispatch('setLayoutWidth', windowWidth()) store.dispatch('setLayoutHeight', windowHeight()) + store.commit('clearServerSideStorage') }) }, loginUser (store, accessToken) { -- cgit v1.2.3-70-g09d2 From ebe095bd769481cc114009e8193494d482f9ff4d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 15 Aug 2022 20:43:38 +0300 Subject: fix prod build again + fetch lists (and follow request) on login, stop fetching on logout, don't start fetching in components --- src/components/lists/lists.js | 3 --- src/components/lists_menu/lists_menu_content.js | 11 +---------- src/components/nav_panel/nav_panel.js | 3 --- src/modules/users.js | 7 +++++++ 4 files changed, 8 insertions(+), 16 deletions(-) (limited to 'src/modules/users.js') diff --git a/src/components/lists/lists.js b/src/components/lists/lists.js index 791b99b2..9aed37f7 100644 --- 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 index 99fea0f0..97b32210 100644 --- 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 index aeccd8a7..b11a258b 100644 --- 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 index fe92d697..c13beb29 100644 --- 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 }) -- cgit v1.2.3-70-g09d2 From 50f5afbce1f2bc4dbd0ddf6c951c7e519dfc6ce3 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 15 Aug 2022 23:19:33 +0300 Subject: add and remove users to/from lists from their profile --- src/components/account_actions/account_actions.js | 4 +- src/components/account_actions/account_actions.vue | 1 + src/components/lists_edit/lists_edit.js | 10 +-- src/components/lists_new/lists_new.js | 4 +- src/components/popover/popover.js | 25 +++++- src/i18n/en.json | 3 +- src/modules/lists.js | 97 +++++++++++++++------- src/modules/users.js | 9 ++ src/services/api/api.service.js | 35 +++++--- .../entity_normalizer/entity_normalizer.service.js | 1 + 10 files changed, 134 insertions(+), 55 deletions(-) (limited to 'src/modules/users.js') diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 99762562..735dd81c 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -1,6 +1,7 @@ import { mapState } from 'vuex' import ProgressButton from '../progress_button/progress_button.vue' import Popover from '../popover/popover.vue' +import UserListMenu from 'src/components/user_list_menu/user_list_menu.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faEllipsisV @@ -19,7 +20,8 @@ const AccountActions = { }, components: { ProgressButton, - Popover + Popover, + UserListMenu }, methods: { showRepeats () { diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 23547f2c..770740e0 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -28,6 +28,7 @@ class="dropdown-divider" /> +