|
|
|
@ -153,23 +153,12 @@ export default { |
|
|
|
currentConversation() { |
|
|
|
return this.$store.getters.conversation(this.token) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Computes whether the current conversation is one to one |
|
|
|
* |
|
|
|
* @return {boolean} The result |
|
|
|
*/ |
|
|
|
isOneToOne() { |
|
|
|
return this.currentConversation?.type === CONVERSATION.TYPE.ONE_TO_ONE |
|
|
|
|| this.currentConversation?.type === CONVERSATION.TYPE.ONE_TO_ONE_FORMER |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
token(newValue, oldValue) { |
|
|
|
const shouldShowSidebar = BrowserStorage.getItem('sidebarOpen') !== 'false' |
|
|
|
// Collapse the sidebar if it's a one to one conversation |
|
|
|
if (this.isOneToOne || !shouldShowSidebar || this.isMobile) { |
|
|
|
if (!shouldShowSidebar || this.isMobile) { |
|
|
|
this.sidebarStore.hideSidebar({ cache: false }) |
|
|
|
} else if (shouldShowSidebar) { |
|
|
|
this.sidebarStore.showSidebar({ cache: false }) |
|
|
|
|