mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-29 15:29:04 +01:00
435ff8e550
Port c73868cd78
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
14 lines
538 B
TypeScript
14 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({}));
|
|
},
|
|
);
|