mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-01-22 07:33:05 -05:00
7224e24054
Port f587ff643f552a32a1c43e103a474a5065cd3657 to glitch-soc Co-authored-by: Eugen Rochko <eugen@zeonfederated.com> Co-authored-by: Claire <claire.github-309c@sitedethib.com> Signed-off-by: Claire <claire.github-309c@sitedethib.com>
19 lines
643 B
TypeScript
19 lines
643 B
TypeScript
import { createAppAsyncThunk } from 'flavours/glitch/store';
|
|
|
|
import { fetchNotifications } from './notification_groups';
|
|
import { expandNotifications } from './notifications';
|
|
|
|
export const initializeNotifications = createAppAsyncThunk(
|
|
'notifications/initialize',
|
|
(_, { dispatch, getState }) => {
|
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
const enableBeta = getState().settings.getIn(
|
|
['notifications', 'groupingBeta'],
|
|
false,
|
|
) as boolean;
|
|
|
|
if (enableBeta) void dispatch(fetchNotifications());
|
|
else dispatch(expandNotifications());
|
|
},
|
|
);
|