From 71a6ced55cc13f7e23e53623b0fbf2c1871a2245 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 10 Oct 2024 15:42:08 +0200 Subject: [PATCH] =?UTF-8?q?[Glitch]=20Fix=20=E2=80=9CMark=20every=20notifi?= =?UTF-8?q?cation=20as=20read=E2=80=9D=20not=20updating=20the=20read=20mar?= =?UTF-8?q?ker=20if=20scrolled=20down?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port e018e6321feb97609b18ac61d3349beb6de170b5 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/reducers/notification_groups.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/reducers/notification_groups.ts b/app/javascript/flavours/glitch/reducers/notification_groups.ts index 3eece4b1d0..d1dacc7964 100644 --- a/app/javascript/flavours/glitch/reducers/notification_groups.ts +++ b/app/javascript/flavours/glitch/reducers/notification_groups.ts @@ -559,7 +559,10 @@ export const notificationGroupsReducer = createReducer( compareId(state.lastReadId, mostRecentGroup.page_max_id) < 0 ) state.lastReadId = mostRecentGroup.page_max_id; - commitLastReadId(state); + + // We don't call `commitLastReadId`, because that is conditional + // and we want to unconditionally update the state instead. + state.readMarkerId = state.lastReadId; }) .addCase(fetchMarkers.fulfilled, (state, action) => { if (