Skip to content

Commit

Permalink
fix: add primary attribute for current user
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <luka@nextcloud.com>
  • Loading branch information
luka-nextcloud authored and mejo- committed Sep 13, 2022
1 parent 9a45c93 commit 640a1e1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/extensions/Mention.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<NodeViewWrapper as="span" class="mention" contenteditable="false">
<NcUserBubble :user="node.attrs.id" :display-name="username" class="mention-user-bubble">
<NcUserBubble :user="node.attrs.id"
:display-name="username"
:primary="isCurrentUser"
class="mention-user-bubble">
@{{ username }}
</NcUserBubble>
</NodeViewWrapper>
Expand All @@ -9,6 +12,7 @@
<script>
import NcUserBubble from '@nextcloud/vue/dist/Components/NcUserBubble.js'
import { NodeViewWrapper } from '@tiptap/vue-2'
import { getCurrentUser } from '@nextcloud/auth'
export default {
name: 'Mention',
Expand All @@ -32,6 +36,11 @@ export default {
username: this.node.attrs.label,
}
},
computed: {
isCurrentUser() {
return this.node.attrs.id === getCurrentUser().uid
},
},
}
</script>
<style scoped>
Expand Down

0 comments on commit 640a1e1

Please sign in to comment.