fix(reactions): do not enable reaction picker when the current user does not have write access

This commit is contained in:
kolaente 2024-04-02 14:48:13 +02:00
parent 1558921f42
commit 95276ceebe
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 6 additions and 0 deletions

View File

@ -16,9 +16,11 @@ import {useColorScheme} from '@/composables/useColorScheme'
const {
entityKind,
entityId,
disabled = false,
} = defineProps<{
entityKind: ReactionKind,
entityId: number,
disabled?: boolean,
}>()
const authStore = useAuthStore()
@ -143,11 +145,13 @@ async function toggleReaction(value: string) {
v-tooltip="getReactionTooltip(users, value)"
class="reaction-button"
:class="{'current-user-has-reacted': hasCurrentUserReactedWithEmoji(value)}"
:disabled
@click="toggleReaction(value)"
>
{{ value }} {{ users.length }}
</BaseButton>
<BaseButton
v-if="!disabled"
ref="emojiPickerButtonRef"
v-tooltip="$t('reaction.add')"
class="reaction-button"

View File

@ -102,6 +102,7 @@
class="mt-2"
entity-kind="comments"
:entity-id="c.id"
:disabled="!canWrite"
/>
</div>
</div>

View File

@ -328,6 +328,7 @@
entity-kind="tasks"
:entity-id="task.id"
class="details"
:disabled="!canWrite"
/>
<!-- Attachments -->