fix bogus "messages failed to load" after logging out
This commit is contained in:
parent
6d76dec265
commit
954c5bd540
1 changed files with 6 additions and 2 deletions
|
@ -246,7 +246,7 @@ class MessageStore extends Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
async doInitialLoad() {
|
async doInitialLoad() {
|
||||||
if (this.channelId === -1)
|
if (this.channelId === -1 || !getItem("auth:token") || getItem("auth:token").length < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
await this.loadOlderMessages();
|
await this.loadOlderMessages();
|
||||||
|
@ -323,7 +323,7 @@ class OverlayStore extends Store {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const selectedChannel = new Store({ id: getItem("app:cache:openChannelId"), name: "none", creator_id: -1 }, "selectedChannel");
|
export const selectedChannel = new Store({ id: -1, name: "none", creator_id: -1 }, "selectedChannel");
|
||||||
export const showSidebar = new Store(true, "showSidebar");
|
export const showSidebar = new Store(true, "showSidebar");
|
||||||
export const smallViewport = new Store(false, "smallViewport");
|
export const smallViewport = new Store(false, "smallViewport");
|
||||||
export const showChannelView = new Store(true, "showChannelView");
|
export const showChannelView = new Store(true, "showChannelView");
|
||||||
|
@ -352,3 +352,7 @@ export const allStores = {
|
||||||
selectedChannel.watch((newSelectedChannel) => {
|
selectedChannel.watch((newSelectedChannel) => {
|
||||||
setItem("app:cache:openChannelId", newSelectedChannel.id);
|
setItem("app:cache:openChannelId", newSelectedChannel.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gateway.subscribe(GatewayEventType.Authenticate, () => {
|
||||||
|
selectedChannel.set("app:cache:openChannelId");
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue