Notifications interface (#5354)
Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import Comment from "~/models/Comment";
|
||||
import Document from "~/models/Document";
|
||||
import FileOperation from "~/models/FileOperation";
|
||||
import Group from "~/models/Group";
|
||||
import Notification from "~/models/Notification";
|
||||
import Pin from "~/models/Pin";
|
||||
import Star from "~/models/Star";
|
||||
import Subscription from "~/models/Subscription";
|
||||
@@ -89,6 +90,7 @@ class WebsocketProvider extends React.Component<Props> {
|
||||
views,
|
||||
subscriptions,
|
||||
fileOperations,
|
||||
notifications,
|
||||
} = this.props;
|
||||
if (!auth.token) {
|
||||
return;
|
||||
@@ -323,6 +325,20 @@ class WebsocketProvider extends React.Component<Props> {
|
||||
auth.team?.updateFromJson(event);
|
||||
});
|
||||
|
||||
this.socket.on(
|
||||
"notifications.create",
|
||||
(event: PartialWithId<Notification>) => {
|
||||
notifications.add(event);
|
||||
}
|
||||
);
|
||||
|
||||
this.socket.on(
|
||||
"notifications.update",
|
||||
(event: PartialWithId<Notification>) => {
|
||||
notifications.add(event);
|
||||
}
|
||||
);
|
||||
|
||||
this.socket.on("pins.create", (event: PartialWithId<Pin>) => {
|
||||
pins.add(event);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user