frontend: prevent loading messages for channels with -1 as the id
This commit is contained in:
parent
261e041792
commit
200f1005b9
1 changed files with 3 additions and 0 deletions
|
@ -224,6 +224,9 @@ class MessageStore extends Store {
|
|||
}
|
||||
|
||||
async loadOlderMessages(beforeCommitToStore=null) {
|
||||
if (this.channelId === -1)
|
||||
return;
|
||||
|
||||
const oldestMessage = this.value[0];
|
||||
const endpoint = oldestMessage ? `channels/${this.channelId}/messages/?before=${oldestMessage.id}` : `channels/${this.channelId}/messages`;
|
||||
const res = await request("GET", apiRoute(endpoint), true, null);
|
||||
|
|
Loading…
Reference in a new issue