From 6de56edba02eaabd3edfcf68eb8ab281f89845ed Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:19:41 +0200 Subject: [PATCH] fix(web): clear hasMore when removing channel states on DM close MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit removeChannelStates cleared messages and readStates but not hasMore. When a closed DM was reopened with the same channel ID, loadMessages saw the stale hasMore entry and skipped loading — showing an empty chat. Now clears hasMore so messages reload on reopen. --- packages/web/src/stores/chatStore.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/web/src/stores/chatStore.ts b/packages/web/src/stores/chatStore.ts index 04b2b846..657568ee 100644 --- a/packages/web/src/stores/chatStore.ts +++ b/packages/web/src/stores/chatStore.ts @@ -687,12 +687,14 @@ export const useChatStore = create((set, get) => ({ const newUnread = new Set(state.unreadChannels); const newReadStates = new Map(state.readStates); const newMessages = new Map(state.messages); + const newHasMore = new Map(state.hasMore); for (const channelId of channelIds) { newUnread.delete(channelId); newReadStates.delete(channelId); newMessages.delete(channelId); + newHasMore.delete(channelId); } - return { unreadChannels: newUnread, readStates: newReadStates, messages: newMessages }; + return { unreadChannels: newUnread, readStates: newReadStates, messages: newMessages, hasMore: newHasMore }; }); },