[Glitch] Fix quickly switching notification filters resulting in empty or incorrect list

Port afb8bc97d0 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2022-08-25 04:29:00 +02:00
parent 3c80b62045
commit 448ed92f76
2 changed files with 8 additions and 8 deletions

View File

@ -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());
};
};