pl-fe: cleanup
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
74d0d4c60b
commit
3071b314ae
2 changed files with 2 additions and 9 deletions
|
@ -87,7 +87,7 @@ const updateNotifications = (notification: BaseNotification) =>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateNotificationsQueue = (notification: BaseNotification, intlMessages: Record<string, string>, intlLocale: string, curPath: string) =>
|
const updateNotificationsQueue = (notification: BaseNotification, intlMessages: Record<string, string>, intlLocale: string) =>
|
||||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||||
if (!notification.type) return; // drop invalid notifications
|
if (!notification.type) return; // drop invalid notifications
|
||||||
if (notification.type === 'chat_mention') return; // Drop chat notifications, handle them per-chat
|
if (notification.type === 'chat_mention') return; // Drop chat notifications, handle them per-chat
|
||||||
|
|
|
@ -118,14 +118,7 @@ const useUserStream = () => {
|
||||||
break;
|
break;
|
||||||
case 'notification':
|
case 'notification':
|
||||||
messages[getLocale()]().then(messages => {
|
messages[getLocale()]().then(messages => {
|
||||||
dispatch(
|
dispatch(updateNotificationsQueue(event.payload, messages, getLocale()));
|
||||||
updateNotificationsQueue(
|
|
||||||
event.payload,
|
|
||||||
messages,
|
|
||||||
getLocale(),
|
|
||||||
window.location.pathname,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue