diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-08-25 04:29:00 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-08-25 05:16:43 +0200 |
commit | 448ed92f76981f40d6faf48ed9d798ee716a04b2 (patch) | |
tree | ab558edfd645052e92881137fdd95a66c1e4eb03 /app/javascript/flavours/glitch/actions/notifications.js | |
parent | 3c80b62045b59f197ea5003357c03b16c1b1bac7 (diff) |
[Glitch] Fix quickly switching notification filters resulting in empty or incorrect list
Port afb8bc97d08c2738da7873ca42fea68e4672d65b to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/actions/notifications.js')
-rw-r--r-- | app/javascript/flavours/glitch/actions/notifications.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js index 3993b1ea5..63c1fe038 100644 --- a/app/javascript/flavours/glitch/actions/notifications.js +++ b/app/javascript/flavours/glitch/actions/notifications.js @@ -158,13 +158,13 @@ const excludeTypesFromFilter = filter => { const noOp = () => {}; -export function expandNotifications({ maxId } = {}, done = noOp) { +export function expandNotifications({ maxId, forceLoad } = {}, done = noOp) { return (dispatch, getState) => { const activeFilter = getState().getIn(['settings', 'notifications', 'quickFilter', 'active']); const notifications = getState().get('notifications'); const isLoadingMore = !!maxId; - if (notifications.get('isLoading')) { + if (notifications.get('isLoading') && !forceLoad) { done(); return; } @@ -343,7 +343,7 @@ export function setFilter (filterType) { path: ['notifications', 'quickFilter', 'active'], value: filterType, }); - dispatch(expandNotifications()); + dispatch(expandNotifications({ forceLoad: true })); dispatch(saveSettings()); }; }; |