Skip to content

Commit

Permalink
chore: removed ChatSubscription update
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva committed Oct 30, 2024
1 parent 242f54b commit 6f6c56c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions apps/meteor/client/hooks/useRoomCloseAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useMutation } from '@tanstack/react-query';
import React from 'react';
import { useTranslation } from 'react-i18next';

import { ChatSubscription } from '../../app/models/client/models/ChatSubscription';
import { UiTextContext } from '../../definition/IRoomTypeConfig';
import { GenericModalDoNotAskAgain } from '../components/GenericModal';
import { roomCoordinator } from '../lib/rooms/roomCoordinator';
Expand All @@ -30,10 +29,6 @@ const CLOSE_ENDPOINTS_BY_ROOM_TYPE = {
l: '/v1/groups.close', // livechat
} as const;

const updateSubscription = (rid: string) => {
ChatSubscription.update({ rid }, { $set: { alert: false, open: false } });
};

export const useRoomCloseAction = ({ rid, type, name }: RoomCloseProps, { redirect = true }: RoomCloseOptions = {}) => {
const { t } = useTranslation();
const setModal = useSetModal();
Expand All @@ -47,8 +42,6 @@ export const useRoomCloseAction = ({ rid, type, name }: RoomCloseProps, { redire
const hideRoom = useMutation({
mutationFn: () => hideRoomEndpoint({ roomId: rid }),
onSuccess: () => {
updateSubscription(rid);

if (redirect) {
router.navigate('/home');
}
Expand Down

0 comments on commit 6f6c56c

Please sign in to comment.