fix cache issue on logout

This commit is contained in:
or-else
2021-05-19 13:44:24 -07:00
parent 02e23c885a
commit 034944877c
+2 -2
View File
@@ -337,10 +337,10 @@ class MessagesView extends React.Component {
} }
leave(oldTopicName) { leave(oldTopicName) {
if (!oldTopicName) { if (!oldTopicName || !this.props.tinode.isTopicCached(oldTopicName)) {
return; return;
} }
let oldTopic = this.props.tinode.getTopic(oldTopicName); const oldTopic = this.props.tinode.getTopic(oldTopicName);
if (oldTopic && oldTopic.isSubscribed()) { if (oldTopic && oldTopic.isSubscribed()) {
oldTopic.leave(false) oldTopic.leave(false)
.catch(() => { /* do nothing here */ }) .catch(() => { /* do nothing here */ })