diff --git a/changelog.d/actions-extra-tap.fix b/changelog.d/actions-extra-tap.fix new file mode 100644 index 000000000..cb54c2e35 --- /dev/null +++ b/changelog.d/actions-extra-tap.fix @@ -0,0 +1 @@ +fixed tapping "Mute..." and "Change visiblity" (admin action) in extra status actions closing the dropdown diff --git a/changelog.d/config-migration.fix b/changelog.d/config-migration.fix new file mode 100644 index 000000000..19f9dc6b1 --- /dev/null +++ b/changelog.d/config-migration.fix @@ -0,0 +1 @@ +Fix legacy settings migration being discarded after it ran. diff --git a/changelog.d/fix-chat-post.fix b/changelog.d/fix-chat-post.fix new file mode 100644 index 000000000..60480a1c0 --- /dev/null +++ b/changelog.d/fix-chat-post.fix @@ -0,0 +1 @@ +Fix error dialog when posting in chat diff --git a/changelog.d/fix-domain-mute.fix b/changelog.d/fix-domain-mute.fix new file mode 100644 index 000000000..1cb910d22 --- /dev/null +++ b/changelog.d/fix-domain-mute.fix @@ -0,0 +1 @@ +domain mute fixedw diff --git a/changelog.d/followers-list.fix b/changelog.d/followers-list.fix new file mode 100644 index 000000000..51e96f90c --- /dev/null +++ b/changelog.d/followers-list.fix @@ -0,0 +1 @@ +Fix followers list showing followed users as non-followed diff --git a/changelog.d/media-proxy-sw-cache.fix b/changelog.d/media-proxy-sw-cache.fix new file mode 100644 index 000000000..bcdc59898 --- /dev/null +++ b/changelog.d/media-proxy-sw-cache.fix @@ -0,0 +1 @@ +Prevent service worker from caching media-proxy responses diff --git a/changelog.d/moderation-tools.fix b/changelog.d/moderation-tools.fix new file mode 100644 index 000000000..1417048a5 --- /dev/null +++ b/changelog.d/moderation-tools.fix @@ -0,0 +1 @@ +fix moderation tools button possibly not appearing for admins diff --git a/changelog.d/moderation.fix b/changelog.d/moderation.fix new file mode 100644 index 000000000..c206a5ea8 --- /dev/null +++ b/changelog.d/moderation.fix @@ -0,0 +1 @@ +Fixed moderation actions requiring confirmation closing user popover diff --git a/changelog.d/streaming.add b/changelog.d/streaming.add new file mode 100644 index 000000000..c6e7de171 --- /dev/null +++ b/changelog.d/streaming.add @@ -0,0 +1 @@ +More timelines now can utilize WebSocket streaming diff --git a/changelog.d/streaming.fix b/changelog.d/streaming.fix new file mode 100644 index 000000000..660a6694f --- /dev/null +++ b/changelog.d/streaming.fix @@ -0,0 +1 @@ +switches between streaming and polling should be more reliable now diff --git a/changelog.d/streaming_indicator.add b/changelog.d/streaming_indicator.add new file mode 100644 index 000000000..547307384 --- /dev/null +++ b/changelog.d/streaming_indicator.add @@ -0,0 +1 @@ +Added an indicator next to instance's name showing WebSocket connection status (if enabled) diff --git a/changelog.d/theme-index-html-fallback.fix b/changelog.d/theme-index-html-fallback.fix new file mode 100644 index 000000000..90a23cacc --- /dev/null +++ b/changelog.d/theme-index-html-fallback.fix @@ -0,0 +1 @@ +Fix theme lists failing to load when custom resource indexes are unavailable diff --git a/changelog.d/themes2-font.fix b/changelog.d/themes2-font.fix new file mode 100644 index 000000000..0842fae8a --- /dev/null +++ b/changelog.d/themes2-font.fix @@ -0,0 +1 @@ +Fix Themes 2.0 applying incorrect fonts diff --git a/changelog.d/themes3.fix b/changelog.d/themes3.fix new file mode 100644 index 000000000..a3192b263 --- /dev/null +++ b/changelog.d/themes3.fix @@ -0,0 +1 @@ +Fixed themes 3 not loading in appearance tab diff --git a/src/App.js b/src/App.js index d7a63bd8a..ed3d43e4a 100644 --- a/src/App.js +++ b/src/App.js @@ -21,6 +21,7 @@ import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.j import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useShoutStore } from 'src/stores/shout.js' +import { useUsersStore } from 'src/stores/users.js' // Helper to unwrap reactive proxies window.toValue = (x) => JSON.parse(JSON.stringify(x)) @@ -153,11 +154,8 @@ export default { ...(navbarColumnStretch ? ['-column-stretch'] : []), ] }, - currentUser() { - return this.$store.state.users.currentUser - }, userBackground() { - return this.currentUser.background_image + return this.currentUser?.background_image }, foreignProfileBackground() { return ( @@ -246,6 +244,7 @@ export default { 'styleDataUsed', 'layoutType', ]), + ...mapState(useUsersStore, ['currentUser']), ...mapState(useInstanceStore, ['styleDataUsed']), ...mapState(useInstanceCapabilitiesStore, [ 'suggestionsEnabled', diff --git a/src/App.vue b/src/App.vue index 84a6f7d3d..bd19c5c10 100644 --- a/src/App.vue +++ b/src/App.vue @@ -26,7 +26,7 @@ class="column -scrollable" :class="{ '-show-scrollbar': showScrollbars }" > - + - - diff --git a/src/components/domain_mute_card/domain_mute_card.js b/src/components/domain_mute_card/domain_mute_card.js index d83896618..274679b8d 100644 --- a/src/components/domain_mute_card/domain_mute_card.js +++ b/src/components/domain_mute_card/domain_mute_card.js @@ -1,5 +1,7 @@ import ProgressButton from 'src/components/progress_button/progress_button.vue' +import { useUsersStore } from 'src/stores/users.js' + const DomainMuteCard = { props: ['domain'], components: { @@ -7,7 +9,7 @@ const DomainMuteCard = { }, computed: { user() { - return this.$store.state.users.currentUser + return useUsersStore().currentUser }, muted() { return this.user.domainMutes.includes(this.domain) @@ -15,10 +17,10 @@ const DomainMuteCard = { }, methods: { unmuteDomain() { - return this.$store.dispatch('unmuteDomain', this.domain) + return useUsersStore().unmuteDomain(this.domain) }, muteDomain() { - return this.$store.dispatch('muteDomain', this.domain) + return useUsersStore().muteDomain(this.domain) }, }, } diff --git a/src/components/draft/draft.js b/src/components/draft/draft.js index 49e186eae..1c7f419c6 100644 --- a/src/components/draft/draft.js +++ b/src/components/draft/draft.js @@ -6,6 +6,7 @@ import PostStatusForm from 'src/components/post_status_form/post_status_form.vue import StatusContent from 'src/components/status_content/status_content.vue' import { useMergedConfigStore } from 'src/stores/merged_config.js' +import { useStatusesStore } from 'src/stores/statuses.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faPollH } from '@fortawesome/free-solid-svg-icons' @@ -65,7 +66,7 @@ const Draft = { }, refStatus() { return this.draft.refId - ? this.$store.state.statuses.allStatusesObject[this.draft.refId] + ? useStatusesStore().allStatuses.get(this.draft.refId) : undefined }, localCollapseSubjectDefault() { diff --git a/src/components/edit_status_modal/edit_status_modal.js b/src/components/edit_status_modal/edit_status_modal.js index 59c142d08..12072d7a2 100644 --- a/src/components/edit_status_modal/edit_status_modal.js +++ b/src/components/edit_status_modal/edit_status_modal.js @@ -4,6 +4,7 @@ import { defineAsyncComponent } from 'vue' import Modal from 'src/components/modal/modal.vue' import { useEditStatusStore } from 'src/stores/editStatus.js' +import { useUsersStore } from 'src/stores/users.js' const EditStatusModal = { components: { @@ -19,7 +20,7 @@ const EditStatusModal = { }, computed: { isLoggedIn() { - return !!this.$store.state.users.currentUser + return !!useUsersStore().currentUser }, modalActivated() { return useEditStatusStore().modalActivated diff --git a/src/components/emoji_input/suggestor.js b/src/components/emoji_input/suggestor.js index c31cb6717..6a7dbff9a 100644 --- a/src/components/emoji_input/suggestor.js +++ b/src/components/emoji_input/suggestor.js @@ -1,3 +1,5 @@ +import { useSearchStore } from 'src/stores/search.js' + /** * suggest - generates a suggestor function to be used by emoji-input * data: object providing source information for specific types of suggestions: @@ -77,7 +79,7 @@ export const suggestUsers = ({ dispatch, state }) => { let timeout = null let cancelUserSearch = null - const userSearch = (query) => dispatch('searchUsers', { query }) + const userSearch = (query) => useSearchStore().searchUsers({ query }) const debounceUserSearch = (query) => { cancelUserSearch?.() return new Promise((resolve, reject) => { diff --git a/src/components/emoji_reactions/emoji_reactions.js b/src/components/emoji_reactions/emoji_reactions.js index acb5404c0..3077ed212 100644 --- a/src/components/emoji_reactions/emoji_reactions.js +++ b/src/components/emoji_reactions/emoji_reactions.js @@ -3,6 +3,8 @@ import UserListPopover from 'src/components/user_list_popover/user_list_popover. import { useInstanceStore } from 'src/stores/instance.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' +import { useStatusesStore } from 'src/stores/statuses.js' +import { useUsersStore } from 'src/stores/users.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faCheck, faMinus, faPlus } from '@fortawesome/free-solid-svg-icons' @@ -40,7 +42,7 @@ const EmojiReactions = { }, {}) }, loggedIn() { - return !!this.$store.state.users.currentUser + return !!useUsersStore().currentUser }, remoteInteractionLink() { return useInstanceStore().getRemoteInteractionLink({ @@ -58,25 +60,22 @@ const EmojiReactions = { reactedWith(emoji) { return this.status.emoji_reactions.find((r) => r.name === emoji).me }, - async fetchEmojiReactionsByIfMissing() { + async fetchEmojiReactionsIfMissing() { const hasNoAccounts = this.status.emoji_reactions.find((r) => !r.accounts) - if (hasNoAccounts) { - return await this.$store.dispatch( - 'fetchEmojiReactionsBy', - this.status.id, - ) + if (!hasNoAccounts) { + return await useStatusesStore().fetchEmojiReactions(this.status.id) } }, reactWith(emoji) { - this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji }) + useStatusesStore().reactWithEmoji(this.status.id, emoji) }, unreact(emoji) { - this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji }) + useStatusesStore().unreactWithEmoji(this.status.id, emoji) }, async emojiOnClick(emoji) { if (!this.loggedIn) return - await this.fetchEmojiReactionsByIfMissing() + await this.fetchEmojiReactionsIfMissing() if (this.reactedWith(emoji)) { this.unreact(emoji) } else { diff --git a/src/components/emoji_reactions/emoji_reactions.vue b/src/components/emoji_reactions/emoji_reactions.vue index 16c69fa40..a8100c0d4 100644 --- a/src/components/emoji_reactions/emoji_reactions.vue +++ b/src/components/emoji_reactions/emoji_reactions.vue @@ -56,7 +56,7 @@ class="emoji-reaction-popover" :normal-button="true" :trigger-attrs="counterTriggerAttrs(reaction)" - @show="fetchEmojiReactionsByIfMissing()" + @show="fetchEmojiReactionsIfMissing()" > {{ reaction.count }} diff --git a/src/components/extra_notifications/extra_notifications.js b/src/components/extra_notifications/extra_notifications.js index 24ed074af..851656ae5 100644 --- a/src/components/extra_notifications/extra_notifications.js +++ b/src/components/extra_notifications/extra_notifications.js @@ -6,6 +6,7 @@ import { useChatsStore } from 'src/stores/chats.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useSyncConfigStore } from 'src/stores/sync_config.js' +import { useUsersStore } from 'src/stores/users.js' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -52,7 +53,7 @@ const ExtraNotifications = { ) }, currentUser() { - return this.$store.state.users.currentUser + return useUsersStore().currentUser }, ...mapGetters(['followRequestCount']), ...mapState(useAnnouncementsStore, { diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js index 3fecc025f..e4d243ff9 100644 --- a/src/components/follow_button/follow_button.js +++ b/src/components/follow_button/follow_button.js @@ -1,11 +1,8 @@ import { defineAsyncComponent } from 'vue' -import { - requestFollow, - requestUnfollow, -} from '../../services/follow_manipulate/follow_manipulate' - import { useMergedConfigStore } from 'src/stores/merged_config.js' +import { useUsersStore } from 'src/stores/users.js' + export default { props: ['relationship', 'user', 'labelFollowing', 'buttonClass'], components: { @@ -64,9 +61,11 @@ export default { }, follow() { this.inProgress = true - requestFollow(this.relationship.id, this.$store).then(() => { - this.inProgress = false - }) + useUsersStore() + .followUser(this.relationship.id) + .finally(() => { + this.inProgress = false + }) }, unfollow() { if (this.shouldConfirmUnfollow) { @@ -76,15 +75,12 @@ export default { } }, doUnfollow() { - const store = this.$store this.inProgress = true - requestUnfollow(this.relationship.id, store).then(() => { - this.inProgress = false - store.commit('removeStatus', { - timeline: 'friends', - userId: this.relationship.id, + useUsersStore() + .unfollowUser(this.relationship.id) + .finally(() => { + this.inProgress = false }) - }) this.hideConfirmUnfollow() }, diff --git a/src/components/follow_card/follow_card.js b/src/components/follow_card/follow_card.js index 8fffbf730..9a8b8746f 100644 --- a/src/components/follow_card/follow_card.js +++ b/src/components/follow_card/follow_card.js @@ -3,6 +3,8 @@ import FollowButton from 'src/components/follow_button/follow_button.vue' import RemoteFollow from 'src/components/remote_follow/remote_follow.vue' import RemoveFollowerButton from 'src/components/remove_follower_button/remove_follower_button.vue' +import { useUsersStore } from 'src/stores/users.js' + const FollowCard = { props: ['user', 'noFollowsYou'], components: { @@ -13,13 +15,13 @@ const FollowCard = { }, computed: { isMe() { - return this.$store.state.users.currentUser.id === this.user.id + return useUsersStore().currentUser.id === this.user.id }, loggedIn() { - return this.$store.state.users.currentUser + return useUsersStore().currentUser }, relationship() { - return this.$store.getters.relationship(this.user.id) + return useUsersStore().relationships.get(this.user.id) }, }, } diff --git a/src/components/follow_card/follow_card.vue b/src/components/follow_card/follow_card.vue index bdb6b8092..d9a508a95 100644 --- a/src/components/follow_card/follow_card.vue +++ b/src/components/follow_card/follow_card.vue @@ -1,5 +1,5 @@ - + diff --git a/src/components/follow_request_card/follow_request_card.js b/src/components/follow_request_card/follow_request_card.js index 294dd2472..c4b43811a 100644 --- a/src/components/follow_request_card/follow_request_card.js +++ b/src/components/follow_request_card/follow_request_card.js @@ -1,9 +1,9 @@ import { defineAsyncComponent } from 'vue' -import { notificationsFromStore } from '../../services/notification_utils/notification_utils.js' import BasicUserCard from '../basic_user_card/basic_user_card.vue' import { useMergedConfigStore } from 'src/stores/merged_config.js' +import { useNotificationsStore } from 'src/stores/notifications.js' import { useOAuthStore } from 'src/stores/oauth.js' import { approveUser, denyUser } from 'src/api/user.js' @@ -24,7 +24,7 @@ const FollowRequestCard = { }, methods: { findFollowRequestNotificationId() { - const notif = notificationsFromStore(this.$store).find( + const notif = useNotificationsStore().data.find( (notif) => notif.from_profile.id === this.user.id && notif.type === 'follow_request', @@ -55,16 +55,11 @@ const FollowRequestCard = { id: this.user.id, credentials: useOAuthStore().token, }) + // TODO fix this.$store.dispatch('removeFollowRequest', this.user) const notifId = this.findFollowRequestNotificationId() - this.$store.dispatch('markSingleNotificationAsSeen', { id: notifId }) - this.$store.dispatch('updateNotification', { - id: notifId, - updater: (notification) => { - notification.type = 'follow' - }, - }) + useNotificationsStore().markSingleNotificationAsSeen(notifId) this.hideApproveConfirmDialog() }, denyUser() { @@ -81,7 +76,8 @@ const FollowRequestCard = { id: this.user.id, credentials: useOAuthStore().token, }).then(() => { - this.$store.dispatch('dismissNotificationLocal', { id: notifId }) + useNotificationsStore().dismissNotificationLocal(notifId) + // TODO fix this.$store.dispatch('removeFollowRequest', this.user) }) this.hideDenyConfirmDialog() diff --git a/src/components/friends_timeline/friends_timeline.js b/src/components/friends_timeline/friends_timeline.js deleted file mode 100644 index b6bee7305..000000000 --- a/src/components/friends_timeline/friends_timeline.js +++ /dev/null @@ -1,14 +0,0 @@ -import Timeline from 'src/components/timeline/timeline.vue' - -const FriendsTimeline = { - components: { - Timeline, - }, - computed: { - timeline() { - return this.$store.state.statuses.timelines.friends - }, - }, -} - -export default FriendsTimeline diff --git a/src/components/friends_timeline/friends_timeline.vue b/src/components/friends_timeline/friends_timeline.vue deleted file mode 100644 index 01a568123..000000000 --- a/src/components/friends_timeline/friends_timeline.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/src/components/interactions/interactions.js b/src/components/interactions/interactions.js index d008c4b30..37873605f 100644 --- a/src/components/interactions/interactions.js +++ b/src/components/interactions/interactions.js @@ -1,6 +1,8 @@ import Notifications from 'src/components/notifications/notifications.vue' import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx' +import { useUsersStore } from 'src/stores/users.js' + const tabModeDict = { mentions: ['mention'], statuses: ['status'], @@ -14,10 +16,9 @@ const tabModeDict = { const Interactions = { data() { return { - allowFollowingMove: - this.$store.state.users.currentUser.allow_following_move, + allowFollowingMove: useUsersStore().currentUser.allow_following_move, filterMode: tabModeDict.mentions, - canSeeReports: this.$store.state.users.currentUser.privileges.has( + canSeeReports: useUsersStore().currentUser.privileges.has( 'reports_manage_reports', ), } diff --git a/src/components/list/list.js b/src/components/list/list.js index c7b924258..20b7c5a78 100644 --- a/src/components/list/list.js +++ b/src/components/list/list.js @@ -98,12 +98,13 @@ const List = { this.fetchFunction(this.page) .then((result) => { + console.log(result) this.loading = false - this.bottomedOut = isEmpty(result.items) + this.bottomedOut = isEmpty(result) if (this.externalItems) return this.page += 1 - this.total = result.count - this.items.push(...result.items) + this.total = result.length + this.items.push(...result) }) .catch((error) => { this.loading = false diff --git a/src/components/lists_edit/lists_edit.js b/src/components/lists_edit/lists_edit.js index 7eb035091..cea9236a5 100644 --- a/src/components/lists_edit/lists_edit.js +++ b/src/components/lists_edit/lists_edit.js @@ -1,5 +1,4 @@ -import { mapState as mapPiniaState } from 'pinia' -import { mapGetters, mapState } from 'vuex' +import { mapState } from 'pinia' import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue' import ListsUserSearch from 'src/components/lists_user_search/lists_user_search.vue' @@ -9,6 +8,7 @@ import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import { useInterfaceStore } from 'src/stores/interface.js' import { useListsStore } from 'src/stores/lists.js' +import { useUsersStore } from 'src/stores/users.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faChevronLeft, faSearch } from '@fortawesome/free-solid-svg-icons' @@ -47,8 +47,8 @@ const ListsNew = { .fetchListAccounts({ listId: this.id }) .then(() => { this.membersUserIds = this.findListAccounts(this.id) - this.membersUserIds.forEach((userId) => { - this.$store.dispatch('fetchUserIfMissing', userId) + this.membersUserIds.forEach((id) => { + useUsersStore().fetchUserIfMissing({ id }) }) }) }, @@ -66,11 +66,8 @@ const ListsNew = { .map((userId) => this.findUser(userId)) .filter(Boolean) }, - ...mapState({ - currentUser: (state) => state.users.currentUser, - }), - ...mapPiniaState(useListsStore, ['findListTitle', 'findListAccounts']), - ...mapGetters(['findUser']), + ...mapState(useUsersStore, ['currentUser', 'findUser']), + ...mapState(useListsStore, ['findListTitle', 'findListAccounts']), }, methods: { onInput() { diff --git a/src/components/lists_menu/lists_menu_content.js b/src/components/lists_menu/lists_menu_content.js index 337ee4d4f..7c422d033 100644 --- a/src/components/lists_menu/lists_menu_content.js +++ b/src/components/lists_menu/lists_menu_content.js @@ -1,10 +1,10 @@ -import { mapState as mapPiniaState } from 'pinia' -import { mapState } from 'vuex' +import { mapState } from 'pinia' import { getListEntries } from 'src/components/navigation/filter.js' import NavigationEntry from 'src/components/navigation/navigation_entry.vue' import { useListsStore } from 'src/stores/lists.js' +import { useUsersStore } from 'src/stores/users.js' export const ListsMenuContent = { props: ['showPin'], @@ -12,12 +12,10 @@ export const ListsMenuContent = { NavigationEntry, }, computed: { - ...mapPiniaState(useListsStore, { + ...mapState(useListsStore, { lists: getListEntries, }), - ...mapState({ - currentUser: (state) => state.users.currentUser, - }), + ...mapState(useUsersStore, ['currentUser']), }, } diff --git a/src/components/lists_timeline/lists_timeline.js b/src/components/lists_timeline/lists_timeline.js deleted file mode 100644 index a06220a37..000000000 --- a/src/components/lists_timeline/lists_timeline.js +++ /dev/null @@ -1,47 +0,0 @@ -import Timeline from 'src/components/timeline/timeline.vue' - -import { useListsStore } from 'src/stores/lists.js' - -const ListsTimeline = { - data() { - return { - listId: null, - } - }, - components: { - Timeline, - }, - computed: { - timeline() { - return this.$store.state.statuses.timelines.list - }, - }, - watch: { - $route: function (route) { - if (route.name === 'lists-timeline' && route.params.id !== this.listId) { - this.listId = route.params.id - this.$store.dispatch('stopFetchingTimeline', 'list') - this.$store.commit('clearTimeline', { timeline: 'list' }) - useListsStore().fetchList({ listId: this.listId }) - this.$store.dispatch('startFetchingTimeline', { - timeline: 'list', - listId: this.listId, - }) - } - }, - }, - created() { - this.listId = this.$route.params.id - useListsStore().fetchList({ listId: this.listId }) - this.$store.dispatch('startFetchingTimeline', { - timeline: 'list', - listId: this.listId, - }) - }, - unmounted() { - this.$store.dispatch('stopFetchingTimeline', 'list') - this.$store.commit('clearTimeline', { timeline: 'list' }) - }, -} - -export default ListsTimeline diff --git a/src/components/lists_timeline/lists_timeline.vue b/src/components/lists_timeline/lists_timeline.vue deleted file mode 100644 index 18156b812..000000000 --- a/src/components/lists_timeline/lists_timeline.vue +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/src/components/lists_user_search/lists_user_search.js b/src/components/lists_user_search/lists_user_search.js index aed3f1ce7..5ac6e679a 100644 --- a/src/components/lists_user_search/lists_user_search.js +++ b/src/components/lists_user_search/lists_user_search.js @@ -32,8 +32,8 @@ const ListsUserSearch = { this.loading = true this.$emit('loading') this.userIds = [] - this.$store - .dispatch('search', { + this.useSearchStore() + .search({ q: query, resolve: true, type: 'accounts', diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index 0309079e8..374e62259 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -1,5 +1,4 @@ -import { mapState as mapPiniaState } from 'pinia' -import { mapState } from 'vuex' +import { mapState } from 'pinia' import UnicodeDomainIndicator from 'src/components/unicode_domain_indicator/unicode_domain_indicator.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue' @@ -12,6 +11,7 @@ import { import { useInstanceStore } from 'src/stores/instance.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useUserHighlightStore } from 'src/stores/user_highlight.js' +import { useUsersStore } from 'src/stores/users.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' @@ -75,7 +75,7 @@ const MentionLink = { }, computed: { user() { - return this.url && this.$store?.getters.findUserByUrl(this.url) + return this.url && useUsersStore().findUserByUrl(this.url) }, isYou() { // FIXME why user !== currentUser??? @@ -156,11 +156,9 @@ const MentionLink = { shouldFadeDomain() { return this.mergedConfig.mentionLinkFadeDomain }, - ...mapPiniaState(useMergedConfigStore, ['mergedConfig']), - ...mapPiniaState(useUserHighlightStore, ['highlight']), - ...mapState({ - currentUser: (state) => state.users.currentUser, - }), + ...mapState(useMergedConfigStore, ['mergedConfig']), + ...mapState(useUserHighlightStore, ['highlight']), + ...mapState(useUsersStore, ['currentUser']), }, } diff --git a/src/components/mention_link/mention_link.vue b/src/components/mention_link/mention_link.vue index 0452cad58..33f0d9db7 100644 --- a/src/components/mention_link/mention_link.vue +++ b/src/components/mention_link/mention_link.vue @@ -31,7 +31,7 @@ @ - - - - diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js index 4eb956f64..163c0e9aa 100644 --- a/src/components/mobile_nav/mobile_nav.js +++ b/src/components/mobile_nav/mobile_nav.js @@ -5,13 +5,15 @@ import NavigationPins from 'src/components/navigation/navigation_pins.vue' import GestureService from '../../services/gesture_service/gesture_service' import { countExtraNotifications, - unseenNotificationsFromStore, + unseenNotifications, } from '../../services/notification_utils/notification_utils' import { useAnnouncementsStore } from 'src/stores/announcements.js' import { useChatsStore } from 'src/stores/chats.js' import { useInstanceStore } from 'src/stores/instance.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' +import { useNotificationsStore } from 'src/stores/notifications.js' +import { useUsersStore } from 'src/stores/users.js' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -53,11 +55,10 @@ const MobileNav = { }, computed: { currentUser() { - return this.$store.state.users.currentUser + return useUsersStore().currentUser }, unseenNotifications() { - return unseenNotificationsFromStore( - this.$store, + return unseenNotifications( useMergedConfigStore().mergedConfig.notificationVisibility, useMergedConfigStore().mergedConfig.ignoreInactionableSeen, ) @@ -145,11 +146,11 @@ const MobileNav = { }, doLogout() { this.$router.replace('/main/public') - this.$store.dispatch('logout') + useUsersStore().logout() this.hideConfirmLogout() }, markNotificationsAsSeen() { - this.$store.dispatch('markNotificationsAsSeen') + useNotificationsStore().markNotificationsAsSeen() }, onScroll({ target: { scrollTop, clientHeight, scrollHeight } }) { this.notificationsAtTop = scrollTop > 0 diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js index 4969352f6..d137331c9 100644 --- a/src/components/mobile_post_status_button/mobile_post_status_button.js +++ b/src/components/mobile_post_status_button/mobile_post_status_button.js @@ -2,6 +2,7 @@ import { debounce } from 'lodash' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { usePostStatusStore } from 'src/stores/post_status.js' +import { useUsersStore } from 'src/stores/users.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faPen } from '@fortawesome/free-solid-svg-icons' @@ -34,7 +35,7 @@ const MobilePostStatusButton = { }, computed: { isLoggedIn() { - return !!this.$store.state.users.currentUser + return useUsersStore().loggedIn }, isHidden() { if (HIDDEN_FOR_PAGES.has(this.$route.name)) { diff --git a/src/components/moderation_tools/moderation_tools.js b/src/components/moderation_tools/moderation_tools.js index ba13afc8b..9b948e306 100644 --- a/src/components/moderation_tools/moderation_tools.js +++ b/src/components/moderation_tools/moderation_tools.js @@ -5,6 +5,7 @@ import Popover from 'src/components/popover/popover.vue' import { useAdminSettingsStore } from 'src/stores/admin_settings.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' +import { useUsersStore } from 'src/stores/users.js' import { library } from '@fortawesome/fontawesome-svg-core' import { faChevronDown } from '@fortawesome/free-solid-svg-icons' @@ -405,7 +406,7 @@ const ModerationTools = { ) }, isAdmin() { - return this.$store.state.users.currentUser.role === 'admin' + return useUsersStore().currentUser.role === 'admin' }, }, methods: { @@ -452,7 +453,7 @@ const ModerationTools = { }, privileged(privilege) { if (this.isAdmin) return true - return this.$store.state.users.currentUser.privileges.has(privilege) + return useUsersStore().currentUser.privileges.has(privilege) }, setTag(tag, value) { useAdminSettingsStore().setUsersTags({ @@ -516,8 +517,7 @@ const ModerationTools = { setOpen(value) { this.open = value }, - maybeShowConfirm(close, { group, name, action, value }) { - close() + maybeShowConfirm({ group, name, action, value }) { this.confirmDialogName = name this.confirmDialogGroup = group this.confirmDialogAction = () => action() diff --git a/src/components/moderation_tools/moderation_tools.vue b/src/components/moderation_tools/moderation_tools.vue index 4da0be0ee..e3da1a84d 100644 --- a/src/components/moderation_tools/moderation_tools.vue +++ b/src/components/moderation_tools/moderation_tools.vue @@ -9,7 +9,7 @@ @show="setOpen(true)" @close="setOpen(false)" > -