diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index ab87d8b8a..1af3e6e4c 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -48,10 +48,10 @@ const AccountActions = { this.showingConfirmBlock = false }, showRepeats() { - this.$store.dispatch('showReblogs', this.user.id) + useUsersStore().showReblogs(this.user.id) }, hideRepeats() { - this.$store.dispatch('hideReblogs', this.user.id) + useUsersStore().hideReblogs(this.user.id) }, blockUser() { if (this.$refs.timedBlockDialog) { @@ -65,11 +65,11 @@ const AccountActions = { } }, doBlockUser() { - this.$store.dispatch('blockUser', { id: this.user.id }) + useUsersStore().blockUser(this.user.id) this.hideConfirmBlock() }, unblockUser() { - this.$store.dispatch('unblockUser', this.user.id) + useUsersStore().unblockUser(this.user.id) }, removeUserFromFollowers() { if (!this.shouldConfirmRemoveUserFromFollowers) { @@ -79,7 +79,7 @@ const AccountActions = { } }, doRemoveUserFromFollowers() { - this.$store.dispatch('removeUserFromFollowers', this.user.id) + useUsersStore().removeUserFromFollowers(this.user.id) this.hideConfirmRemoveUserFromFollowers() }, reportUser() { diff --git a/src/components/block_card/block_card.js b/src/components/block_card/block_card.js index 11120574b..2ee578520 100644 --- a/src/components/block_card/block_card.js +++ b/src/components/block_card/block_card.js @@ -36,13 +36,13 @@ const BlockCard = { }, methods: { unblockUser() { - this.$store.dispatch('unblockUser', this.user.id) + useUsersStore().unblockUser(this.user.id) }, blockUser() { if (this.blockExpiration) { this.$refs.timedBlockDialog.optionallyPrompt() } else { - this.$store.dispatch('blockUser', { id: this.user.id }) + useUsersStore().blockUser(this.user.id) } }, }, diff --git a/src/components/confirm_modal/mute_confirm.js b/src/components/confirm_modal/mute_confirm.js index 862405a8e..2247c2e91 100644 --- a/src/components/confirm_modal/mute_confirm.js +++ b/src/components/confirm_modal/mute_confirm.js @@ -4,6 +4,7 @@ import { defineAsyncComponent } from 'vue' import Select from 'src/components/select/select.vue' import { useMergedConfigStore } from 'src/stores/merged_config.js' +import { useStatusesStore } from 'src/stores/statuses.js' import { useUsersStore } from 'src/stores/users.js' export default { @@ -69,17 +70,17 @@ export default { switch (this.type) { case 'domain': { if (!this.domainIsMuted) { - this.$store.dispatch('muteDomain', this.domain) + useUsersStore().muteDomain(this.domain) } else { - this.$store.dispatch('unmuteDomain', this.domain) + useUsersStore().unmuteDomain(this.domain) } break } case 'conversation': { if (!this.conversationIsMuted) { - this.$store.dispatch('muteConversation', { id: this.status.id }) + useStatusesStore().muteConversation(this.status.id) } else { - this.$store.dispatch('unmuteConversation', { id: this.status.id }) + useStatusesStore().unmuteConversation(this.status.id) } break } diff --git a/src/components/status_action_buttons/action_button_container.js b/src/components/status_action_buttons/action_button_container.js index 3c371ac74..cdb83c0b5 100644 --- a/src/components/status_action_buttons/action_button_container.js +++ b/src/components/status_action_buttons/action_button_container.js @@ -4,6 +4,7 @@ import Popover from 'src/components/popover/popover.vue' import ActionButton from './action_button.vue' import { useAdminSettingsStore } from 'src/stores/admin_settings.js' +import { useStatusesStore } from 'src/stores/statuses.js' import { useUsersStore } from 'src/stores/users.js' import genRandomSeed from 'src/services/random_seed/random_seed.service.js' @@ -105,13 +106,13 @@ export default { } }, unmuteUser() { - return this.$store.dispatch('unmuteUser', this.user.id) + return useUsersStore().unmuteUser(this.user.id) }, unmuteConversation() { - return this.$store.dispatch('unmuteConversation', { id: this.status.id }) + return useStatusesStore().unmuteConversation(this.status.id) }, unmuteDomain() { - return this.$store.dispatch('unmuteDomain', this.domain) + return useUsersStore().unmuteDomain(this.domain) }, toggleUserMute() { if (this.userIsMuted) { diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index f4b1123e2..5304608b8 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -454,13 +454,13 @@ export default { this.$refs.timedMuteDialog.optionallyPrompt() }, unmuteUser() { - this.$store.dispatch('unmuteUser', this.user.id) + return useUsersStore().unmuteUser(this.user.id) }, subscribeUser() { - return this.$store.dispatch('subscribeUser', this.user.id) + return useUsersStore().subscribeUser(this.user.id) }, unsubscribeUser() { - return this.$store.dispatch('unsubscribeUser', this.user.id) + return useUsersStore().unsubscribeUser(this.user.id) }, linkClicked({ target }) { if (target.tagName === 'SPAN') { diff --git a/src/components/user_timed_filter_modal/user_timed_filter_modal.js b/src/components/user_timed_filter_modal/user_timed_filter_modal.js index f0c150999..360c73ee8 100644 --- a/src/components/user_timed_filter_modal/user_timed_filter_modal.js +++ b/src/components/user_timed_filter_modal/user_timed_filter_modal.js @@ -5,6 +5,7 @@ import Select from 'src/components/select/select.vue' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useSyncConfigStore } from 'src/stores/sync_config.js' +import { useUsersStore } from 'src/stores/users.js' import { durationStrToMs } from 'src/services/date_utils/date_utils.js' @@ -64,13 +65,6 @@ const UserTimedFilterModal = { expirySeconds() { return Math.floor(durationStrToMs(this.expiryString) / 1000) }, - requestBody() { - const object = { id: this.user.id } - if (!this.forever) { - object.expiresIn = this.expirySeconds - } - return object - }, }, watch: { expiration(newVal) { @@ -89,7 +83,10 @@ const UserTimedFilterModal = { }, accept() { if (this.isMute) { - this.$store.dispatch('muteUser', this.requestBody) + useUsersStore().muteUser( + this.user.id, + this.forever ? undefined : this.expirySeconds, + ) if (this.dontAskAgain) { useSyncConfigStore().setSimplePrefAndSave({ path: 'onMuteDefaultAction', @@ -97,7 +94,10 @@ const UserTimedFilterModal = { }) } } else { - this.$store.dispatch('blockUser', this.requestBody) + useUsersStore().blockUser( + this.user.id, + this.forever ? undefined : this.expirySeconds, + ) if (this.dontAskAgain) { useSyncConfigStore().setSimplePrefAndSave({ path: 'onBlockDefaultAction',