From 200f1005b9350667d0728873798c28b9a4b06349 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Sun, 8 May 2022 22:02:16 +0300 Subject: [PATCH] frontend: prevent loading messages for channels with -1 as the id --- frontend/src/stores.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/stores.js b/frontend/src/stores.js index aba5fc4..d47f378 100644 --- a/frontend/src/stores.js +++ b/frontend/src/stores.js @@ -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);