Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
4 KB
Referenced Files
None
Subscribers
None
diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js
index e4d12ec635..7ad91f2366 100644
--- a/src/components/follow_button/follow_button.js
+++ b/src/components/follow_button/follow_button.js
@@ -1,93 +1,89 @@
import { defineAsyncComponent } from 'vue'
import { useMergedConfigStore } from 'src/stores/merged_config.js'
import { useUsersStore } from 'src/stores/users.js'
export default {
props: ['relationship', 'user', 'labelFollowing', 'buttonClass'],
components: {
ConfirmModal: defineAsyncComponent(
() => import('src/components/confirm_modal/confirm_modal.vue'),
),
},
data() {
return {
inProgress: false,
showingConfirmUnfollow: false,
}
},
computed: {
shouldConfirmUnfollow() {
return useMergedConfigStore().mergedConfig.modalOnUnfollow
},
isPressed() {
return this.inProgress || this.relationship.following
},
title() {
if (this.inProgress || this.relationship.following) {
return this.$t('user_card.follow_unfollow')
} else if (this.relationship.requested) {
return this.$t('user_card.follow_cancel')
} else {
return this.$t('user_card.follow')
}
},
label() {
if (this.inProgress) {
return this.$t('user_card.follow_progress')
} else if (this.relationship.following) {
return this.labelFollowing || this.$t('user_card.following')
} else if (this.relationship.requested) {
return this.$t('user_card.follow_sent')
} else {
return this.$t('user_card.follow')
}
},
disabled() {
return this.inProgress || this.user.deactivated
},
},
methods: {
showConfirmUnfollow() {
this.showingConfirmUnfollow = true
},
hideConfirmUnfollow() {
this.showingConfirmUnfollow = false
},
onClick() {
this.relationship.following || this.relationship.requested
? this.unfollow()
: this.follow()
},
follow() {
this.inProgress = true
useUsersStore()
.followUser(this.relationship.id)
- .then(() => {
+ .finally(() => {
this.inProgress = false
})
},
unfollow() {
if (this.shouldConfirmUnfollow) {
this.showConfirmUnfollow()
} else {
this.doUnfollow()
}
},
doUnfollow() {
const store = this.$store
this.inProgress = true
useUsersStore()
.unfollowUser(this.relationship.id)
- .then(() => {
+ .finally(() => {
this.inProgress = false
- store.commit('removeStatus', {
- timeline: 'friends',
- userId: this.relationship.id,
- })
})
this.hideConfirmUnfollow()
},
},
}
diff --git a/src/components/mute_card/mute_card.js b/src/components/mute_card/mute_card.js
index 441c28f1c8..ca14eb9cad 100644
--- a/src/components/mute_card/mute_card.js
+++ b/src/components/mute_card/mute_card.js
@@ -1,43 +1,43 @@
import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue'
import UserTimedFilterModal from 'src/components/user_timed_filter_modal/user_timed_filter_modal.vue'
import { useUsersStore } from 'src/stores/users.js'
const MuteCard = {
props: ['userId'],
computed: {
user() {
return useUsersStore().findUser(this.userId)
},
relationship() {
return useUsersStore().relationship(this.userId)
},
muted() {
return this.relationship.muting
},
muteExpiryAvailable() {
return Object.hasOwn(this.user, 'mute_expires_at')
},
muteExpiry() {
return this.user.mute_expires_at === false
? this.$t('user_card.mute_expires_forever')
: this.$t('user_card.mute_expires_at', [
new Date(this.user.mute_expires_at).toLocaleString(),
])
},
},
components: {
BasicUserCard,
UserTimedFilterModal,
},
methods: {
unmuteUser() {
- this.$store.dispatch('unmuteUser', this.userId)
+ useUsersStore().unmuteUser(this.user.id)
},
muteUser() {
this.$refs.timedMuteDialog.optionallyPrompt()
},
},
}
export default MuteCard

File Metadata

Mime Type
text/x-diff
Expires
Thu, Oct 29, 11:38 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1798065
Default Alt Text
(4 KB)

Event Timeline