24 lines
566 B
TypeScript
24 lines
566 B
TypeScript
|
import { createAction } from '@reduxjs/toolkit';
|
||
|
|
||
|
import type { ApiAccountJSON } from '../api_types/accounts';
|
||
|
// To be replaced once ApiNotificationJSON type exists
|
||
|
interface FakeApiNotificationJSON {
|
||
|
type: string;
|
||
|
account: ApiAccountJSON;
|
||
|
}
|
||
|
|
||
|
export const notificationsUpdate = createAction(
|
||
|
'notifications/update',
|
||
|
({
|
||
|
playSound,
|
||
|
...args
|
||
|
}: {
|
||
|
notification: FakeApiNotificationJSON;
|
||
|
usePendingItems: boolean;
|
||
|
playSound: boolean;
|
||
|
}) => ({
|
||
|
payload: args,
|
||
|
meta: { playSound: playSound ? { sound: 'boop' } : undefined },
|
||
|
}),
|
||
|
);
|