Skip to content

Commit 6b8e5b2

Browse files
committed
Renaming and condition refactoring
Signed-off-by: DorraJaouad <[email protected]>
1 parent e296497 commit 6b8e5b2

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

src/components/LeftSidebar/LeftSidebar.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<template #icon>
9797
<Note :size="20" />
9898
</template>
99-
{{ t('spreed','New Personal Note') }}
99+
{{ t('spreed','New personal note') }}
100100
</NcActionButton>
101101

102102
<NcActionButton close-after-click
@@ -409,7 +409,7 @@ export default {
409409
},
410410
411411
hasNoteToSelf() {
412-
return this.conversationsList.filter(conversation => conversation.type === CONVERSATION.TYPE.NOTE_TO_SELF).length
412+
return this.conversationsList.find(conversation => conversation.type === CONVERSATION.TYPE.NOTE_TO_SELF)
413413
},
414414
415415
sourcesWithoutResults() {
@@ -632,7 +632,7 @@ export default {
632632
}
633633
},
634634
635-
addAndOpenConversation(conversation) {
635+
switchToConversation(conversation) {
636636
this.$store.dispatch('addConversation', conversation)
637637
this.abortSearch()
638638
this.$router.push({
@@ -644,13 +644,13 @@ export default {
644644
async createConversation(name) {
645645
const response = await createPrivateConversation(name)
646646
const conversation = response.data.ocs.data
647-
this.addAndOpenConversation(conversation)
647+
this.switchToConversation(conversation)
648648
},
649649
650650
async restoreNoteToSelfConversation() {
651651
const response = await fetchNoteToSelfConversation()
652652
const conversation = response.data.ocs.data
653-
this.addAndOpenConversation(conversation)
653+
this.switchToConversation(conversation)
654654
},
655655
656656
hasOneToOneConversationWith(userId) {

src/components/RightSidebar/RightSidebar.vue

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export default {
285285
this.conversationName = this.conversation.displayName
286286
}
287287
288-
if (newConversation.token === oldConversation.token || this.isOneToOne) {
288+
if (newConversation.token === oldConversation.token || !this.showParticipantsTab) {
289289
return
290290
}
291291
@@ -302,19 +302,10 @@ export default {
302302
}
303303
},
304304
305-
isNoteToSelf: {
305+
showParticipantsTab: {
306306
immediate: true,
307307
handler(value) {
308-
if (value) {
309-
this.activeTab = 'shared-items'
310-
}
311-
},
312-
},
313-
314-
isOneToOne: {
315-
immediate: true,
316-
handler(value) {
317-
if (value) {
308+
if (!value) {
318309
this.activeTab = 'shared-items'
319310
}
320311
},

0 commit comments

Comments
 (0)