Skip to content

Commit 2f68722

Browse files
authored
Merge pull request #409 from Harbour-Enterprises/nick/har-9330-fix-new-comment-user
HAR-9330 - Fix comment header user
2 parents a54c17b + 4c9ac58 commit 2f68722

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

packages/superdoc/src/components/CommentsLayer/CommentHeader.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const props = defineProps({
2626
type: Boolean,
2727
required: false,
2828
default: false,
29-
}
29+
},
3030
});
3131
3232
const { proxy } = getCurrentInstance();
@@ -98,14 +98,18 @@ const handleResolve = () => emit('resolve');
9898
const handleReject = () => emit('reject');
9999
const handleSelect = (value) => emit('overflow-select', value);
100100
101+
const getCurrentUser = computed(() => {
102+
if (props.isPendingInput) return proxy.$superdoc.config.user;
103+
return props.comment.getCommentUser();
104+
});
101105
</script>
102106

103107
<template>
104108
<div class="card-section comment-header">
105109
<div class="comment-header-left">
106-
<Avatar :user="props.comment.getCommentUser()" class="avatar" />
110+
<Avatar :user="getCurrentUser" class="avatar" />
107111
<div class="user-info">
108-
<div class="user-name">{{ props.comment.getCommentUser().name }}</div>
112+
<div class="user-name">{{ getCurrentUser.name }}</div>
109113
<div class="user-timestamp" v-if="props.comment.createdTime">{{ formatDate(props.comment.createdTime) }}</div>
110114
</div>
111115
</div>

0 commit comments

Comments
 (0)