Compare commits

...

2 commits

Author SHA1 Message Date
Henry Jameson
c1ac4674af Merge branch 'fixes-roundup3' into shigusegubu-themes3 2025-01-27 17:56:23 +02:00
Henry Jameson
d01e069bf2 fixes to mute menu and mute description 2025-01-27 17:53:34 +02:00
7 changed files with 34 additions and 26 deletions

View file

@ -5,7 +5,7 @@ import ConfirmModal from './confirm_modal.vue'
import Select from 'src/components/select/select.vue' import Select from 'src/components/select/select.vue'
export default { export default {
props: ['type', 'user'], props: ['type', 'user', 'status'],
emits: ['hide', 'show', 'muted'], emits: ['hide', 'show', 'muted'],
data: () => ({ data: () => ({
showing: false, showing: false,

View file

@ -255,7 +255,7 @@ const Status = {
muteReasons () { muteReasons () {
return [ return [
this.userIsMuted ? 'user' : null, this.userIsMuted ? 'user' : null,
status.thread_muted ? 'thread' : null, this.status.thread_muted ? 'thread' : null,
(this.muteWordHits.length > 0) ? 'wordfilter' : null, (this.muteWordHits.length > 0) ? 'wordfilter' : null,
(this.muteBotStatuses && this.botStatus) ? 'bot' : null, (this.muteBotStatuses && this.botStatus) ? 'bot' : null,
(this.muteSensitiveStatuses && this.sensitiveStatus) ? 'nsfw' : null (this.muteSensitiveStatuses && this.sensitiveStatus) ? 'nsfw' : null
@ -280,14 +280,19 @@ const Status = {
case 'nsfw': return this.$t('status.sensitive_muted') case 'nsfw': return this.$t('status.sensitive_muted')
} }
} }
return this.$t( console.log(this.status)
'status.multi_reason_mute', if (this.muteReasons.length > 1) {
{ return this.$t(
main: mainReason(), 'status.multi_reason_mute',
numReasonsMore: this.muteReasons.length - 1 {
}, main: mainReason(),
this.muteReasons.length - 1 numReasonsMore: this.muteReasons.length - 1
) },
this.muteReasons.length - 1
)
} else {
return mainReason()
}
}, },
muted () { muted () {
if (this.statusoid.user.id === this.currentUser.id) return false if (this.statusoid.user.id === this.currentUser.id) return false
@ -299,7 +304,7 @@ const Status = {
const { reblog } = status const { reblog } = status
const relationship = this.$store.getters.relationship(status.user.id) const relationship = this.$store.getters.relationship(status.user.id)
const relationshipReblog = reblog && this.$store.getters.relationship(reblog.user.id) const relationshipReblog = reblog && this.$store.getters.relationship(reblog.user.id)
return status.muted || return (status.muted && !status.thread_muted) ||
// Reprööt of a muted post according to BE // Reprööt of a muted post according to BE
(reblog && reblog.muted) || (reblog && reblog.muted) ||
// Muted user // Muted user

View file

@ -58,8 +58,8 @@ export default {
unmuteUser () { unmuteUser () {
return this.$store.dispatch('unmuteUser', this.user.id) return this.$store.dispatch('unmuteUser', this.user.id)
}, },
unmuteThread () { unmuteConversation () {
return this.$store.dispatch('unmuteConversation', this.user.id) return this.$store.dispatch('unmuteConversation', { id: this.status.id })
}, },
unmuteDomain () { unmuteDomain () {
return this.$store.dispatch('unmuteDomain', this.user.id) return this.$store.dispatch('unmuteDomain', this.user.id)

View file

@ -2,7 +2,7 @@
<div> <div>
<Popover <Popover
v-if="button.dropdown?.()" v-if="button.dropdown?.()"
trigger="click" :trigger="$attrs.extra ? 'hover' : 'click'"
:offset="{ y: 5 }" :offset="{ y: 5 }"
:placement="$attrs.extra ? 'right' : 'top'" :placement="$attrs.extra ? 'right' : 'top'"
> >
@ -40,13 +40,13 @@
<div class="menu-item dropdown-item extra-action -icon"> <div class="menu-item dropdown-item extra-action -icon">
<button <button
class="main-button" class="main-button"
@click="toggleUserMute" @click="toggleConversationMute"
> >
<FAIcon <FAIcon
icon="folder-tree" icon="folder-tree"
fixed-width fixed-width
/> />
<template v-if="threadIsMuted"> <template v-if="conversationIsMuted">
{{ $t('status.unmute_conversation') }} {{ $t('status.unmute_conversation') }}
</template> </template>
<template v-else> <template v-else>
@ -81,19 +81,22 @@
v-bind="$attrs" v-bind="$attrs"
/> />
<teleport to="#modal"> <teleport to="#modal">
<mute-confirm <MuteConfirm
ref="confirmConversation" ref="confirmConversation"
type="conversation" type="conversation"
:status="status" :status="status"
/>
<mute-confirm
ref="confirmDomain"
type="domain"
:user="user" :user="user"
/> />
<mute-confirm <MuteConfirm
ref="confirmDomain"
type="domain"
:status="status"
:user="user"
/>
<MuteConfirm
ref="confirmUser" ref="confirmUser"
type="user" type="user"
:status="status"
:user="user" :user="user"
/> />
</teleport> </teleport>

View file

@ -311,7 +311,7 @@
/> />
</div> </div>
<teleport to="#modal"> <teleport to="#modal">
<mute-confirm <MuteConfirm
ref="confirmation" ref="confirmation"
type="user" type="user"
:user="user" :user="user"

View file

@ -1259,7 +1259,7 @@
"copy_link": "Copy link to status", "copy_link": "Copy link to status",
"external_source": "External source", "external_source": "External source",
"muted_words": "Wordfiltered: {word} | Wordfiltered: {word} and {numWordsMore} more words", "muted_words": "Wordfiltered: {word} | Wordfiltered: {word} and {numWordsMore} more words",
"multi_reason_mute": "{main} | {main} + one more reason | {main} + {numReasonsMore} more reasons", "multi_reason_mute": "{main} + one more reason | {main} + {numReasonsMore} more reasons",
"muted_user": "User muted", "muted_user": "User muted",
"thread_muted": "Thread muted", "thread_muted": "Thread muted",
"thread_muted_and_words": ", has words:", "thread_muted_and_words": ", has words:",

View file

@ -549,11 +549,11 @@ const statuses = {
rootState.api.backendInteractor.unpinOwnStatus({ id: statusId }) rootState.api.backendInteractor.unpinOwnStatus({ id: statusId })
.then((status) => dispatch('addNewStatuses', { statuses: [status] })) .then((status) => dispatch('addNewStatuses', { statuses: [status] }))
}, },
muteConversation ({ rootState, commit }, statusId) { muteConversation ({ rootState, commit }, { id: statusId }) {
return rootState.api.backendInteractor.muteConversation({ id: statusId }) return rootState.api.backendInteractor.muteConversation({ id: statusId })
.then((status) => commit('setMutedStatus', status)) .then((status) => commit('setMutedStatus', status))
}, },
unmuteConversation ({ rootState, commit }, statusId) { unmuteConversation ({ rootState, commit }, { id: statusId }) {
return rootState.api.backendInteractor.unmuteConversation({ id: statusId }) return rootState.api.backendInteractor.unmuteConversation({ id: statusId })
.then((status) => commit('setMutedStatus', status)) .then((status) => commit('setMutedStatus', status))
}, },