2024-08-27 23:55:51 +09:00
|
|
|
import { selectUseGroupedNotifications } from 'mastodon/selectors/settings';
|
2024-07-18 23:36:09 +09:00
|
|
|
import { createAppAsyncThunk } from 'mastodon/store';
|
|
|
|
|
|
|
|
import { fetchNotifications } from './notification_groups';
|
|
|
|
import { expandNotifications } from './notifications';
|
|
|
|
|
|
|
|
export const initializeNotifications = createAppAsyncThunk(
|
|
|
|
'notifications/initialize',
|
|
|
|
(_, { dispatch, getState }) => {
|
2024-08-27 23:55:51 +09:00
|
|
|
if (selectUseGroupedNotifications(getState()))
|
|
|
|
void dispatch(fetchNotifications());
|
2024-08-21 01:18:33 +09:00
|
|
|
else void dispatch(expandNotifications({}));
|
2024-07-18 23:36:09 +09:00
|
|
|
},
|
|
|
|
);
|