From 693173f2ca6cad943f812c9257281b3974699949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:27:56 +0000 Subject: [PATCH] Fix issue with the no-results slot being (incorrectly) used --- frontend/views/containers/chatroom/ChatMain.vue | 5 +++++ test/cypress/support/commands.js | 1 + 2 files changed, 6 insertions(+) diff --git a/frontend/views/containers/chatroom/ChatMain.vue b/frontend/views/containers/chatroom/ChatMain.vue index 79e2199008..b411aadb09 100644 --- a/frontend/views/containers/chatroom/ChatMain.vue +++ b/frontend/views/containers/chatroom/ChatMain.vue @@ -1055,6 +1055,11 @@ export default ({ if (!this.checkEventSourceConsistency(chatRoomID)) return if (completed === true) { + // If there's messages, call $state.loaded. This has the effect that + // the no-more message will be shown instead of the no-results message + if (this.messages.length) { + $state.loaded() + } $state.complete() if (!this.$refs.conversation || this.$refs.conversation.scrollHeight === this.$refs.conversation.clientHeight) { diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 860c1be5b6..f385bb4a51 100644 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -689,6 +689,7 @@ Cypress.Commands.add('giAddNewChatroom', ({ cy.giWaitUntilMessagesLoaded() cy.getByDT('conversationWrapper').within(() => { + // This checks for the 'no-more' slot of the infinite loader cy.get('.infinite-status-prompt:nth-child(3)') .invoke('attr', 'style') .should('not.include', 'display: none')