Skip to content

Commit

Permalink
[backend] Add show toast to users who were in the room when the room …
Browse files Browse the repository at this point in the history
…was deleted
  • Loading branch information
lim396 committed Feb 8, 2024
1 parent 1688c91 commit 2f024cc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/app/lib/client-socket-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ export default function SocketProvider() {
const pathName = usePathname();
const router = useRouter();

const showDeleteRoomNotificationToast = () => {
toast({
title: "Notification",
description: "The chat room has been deleted",
});
};

const handleDeleteRoomEvent = useCallback(
(data: DeleteRoomEvent) => {
if (pathName === "/room/" + data.roomId.toString()) {
showDeleteRoomNotificationToast();
router.push("/room");
router.refresh();
} else if (
Expand Down

0 comments on commit 2f024cc

Please sign in to comment.