mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-02 09:19:03 +01:00
14 lines
524 B
TypeScript
14 lines
524 B
TypeScript
import { selectUseGroupedNotifications } from 'mastodon/selectors/settings';
|
|
import { createAppAsyncThunk } from 'mastodon/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({}));
|
|
},
|
|
);
|