From 786f2518e7ff43c574aba205c4396582107b957e Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Tue, 14 Apr 2020 11:41:38 +1000 Subject: [PATCH] chat-fe: resubscribe message iff chatSynced is populated Previously, if a room was navigated to directly, the resubscribe message would show before the chatSynced state was loaded. Initialises chatSynced as null and checks it is not null before showing the resubscribe message. --- pkg/interface/chat/src/js/components/chat.js | 1 + pkg/interface/chat/src/js/store.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/interface/chat/src/js/components/chat.js b/pkg/interface/chat/src/js/components/chat.js index cf5ba89368..d669beede1 100644 --- a/pkg/interface/chat/src/js/components/chat.js +++ b/pkg/interface/chat/src/js/components/chat.js @@ -274,6 +274,7 @@ export class ChatScreen extends Component { this.scrollElement = el; }}> { ( + props.chatSynced && !(props.station in props.chatSynced) && (messages.length > 0) ) ? ( diff --git a/pkg/interface/chat/src/js/store.js b/pkg/interface/chat/src/js/store.js index 375b8154ea..ddfe6d8bcb 100644 --- a/pkg/interface/chat/src/js/store.js +++ b/pkg/interface/chat/src/js/store.js @@ -11,7 +11,7 @@ class Store { constructor() { this.state = { inbox: {}, - chatSynced: {}, + chatSynced: null, contacts: {}, permissions: {}, invites: {},