0
0
Fork 0

Fix quickly switching notification filters resulting in empty or incorrect list (#18960)

This commit is contained in:
Claire 2022-08-25 04:29:00 +02:00 committed by GitHub
parent 50487db122
commit afb8bc97d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -141,13 +141,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;
}
@ -243,7 +243,7 @@ export function setFilter (filterType) {
path: ['notifications', 'quickFilter', 'active'],
value: filterType,
});
dispatch(expandNotifications());
dispatch(expandNotifications({ forceLoad: true }));
dispatch(saveSettings());
};
};