mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-01-22 07:33:05 -05:00
435ff8e550
Port c73868cd78592780cb9e0be6985fe2f34b7c91cd to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
15 lines
538 B
TypeScript
15 lines
538 B
TypeScript
import { selectUseGroupedNotifications } from 'flavours/glitch/selectors/settings';
|
|
import { createAppAsyncThunk } from 'flavours/glitch/store';
|
|
|
|
import { fetchNotifications } from './notification_groups';
|
|
import { expandNotifications } from './notifications';
|
|
|
|
export const initializeNotifications = createAppAsyncThunk(
|
|
'notifications/initialize',
|
|
(_, { dispatch, getState }) => {
|
|
if (selectUseGroupedNotifications(getState()))
|
|
void dispatch(fetchNotifications());
|
|
else void dispatch(expandNotifications({}));
|
|
},
|
|
);
|