Skip to content

Commit

Permalink
1108 chat notifications (#1118)
Browse files Browse the repository at this point in the history
* Removed sse listeners

* Increased package version to use new header with sse.
  • Loading branch information
ExiRain authored Jan 14, 2025
1 parent d23d2d4 commit ee03278
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion GUI/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"prettier": "prettier --write \"{,!(node_modules)/**/}*.{ts,tsx,js,json,css,less,scss}\""
},
"dependencies": {
"@buerokratt-ria/header": "^0.1.17",
"@buerokratt-ria/header": "^0.1.18",
"@buerokratt-ria/menu": "^0.2.4",
"@buerokratt-ria/styles": "^0.0.1",
"@fontsource/roboto": "^4.5.8",
Expand Down
6 changes: 0 additions & 6 deletions GUI/src/pages/Chat/ChatActive/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import StartAServiceModal from '../StartAServiceModal';
import ChatTrigger from './ChatTrigger';
import { v4 as uuidv4 } from 'uuid';
import { useLocation } from 'react-router-dom';
import sse from 'services/sse-service';
import './ChatActive.scss';
import withAuthorization from 'hoc/with-authorization';
import { ROLES } from 'utils/constants';
Expand Down Expand Up @@ -58,11 +57,6 @@ const ChatActive: FC = () => {
useHeaderStore.getState().loadActiveChats();
}, []);

useEffect(() => {
const events = sse(`/chat-list`, loadActiveChats);
return () => events.close();
}, []);

const { data: csaNameVisiblity } = useQuery<{ isVisible: boolean }>({
queryKey: ['agents/admin/name-visibility', 'prod'],
});
Expand Down
6 changes: 0 additions & 6 deletions GUI/src/pages/Chat/ChatPending/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ChatTrigger from '../ChatActive/ChatTrigger';
import clsx from 'clsx';
import ForwardToColleaugeModal from '../ForwardToColleaugeModal';
import ForwardToEstablishmentModal from '../ForwardToEstablishmentModal';
import sse from 'services/sse-service';
import { v4 as uuidv4 } from 'uuid';
import './ChatPending.scss';
import { userStore as useHeaderStore } from '@buerokratt-ria/header';
Expand Down Expand Up @@ -49,11 +48,6 @@ const ChatPending: FC = () => {
useHeaderStore.getState().loadPendingChats();
}, []);

useEffect(() => {
const events = sse(`/chat-list`, loadPendingChats);
return () => events.close();
}, []);

const { data: csaNameVisiblity } = useQuery<{ isVisible: boolean }>({
queryKey: ['agents/admin/name-visibility', 'prod'],
});
Expand Down
6 changes: 0 additions & 6 deletions GUI/src/pages/Chat/ChatUnanswered/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ChatTrigger from '../ChatActive/ChatTrigger';
import clsx from 'clsx';
import ForwardToColleaugeModal from '../ForwardToColleaugeModal';
import ForwardToEstablishmentModal from '../ForwardToEstablishmentModal';
import sse from 'services/sse-service';
import './ChatUnanswered.scss';
import withAuthorization from 'hoc/with-authorization';
import { ROLES } from 'utils/constants';
Expand Down Expand Up @@ -51,11 +50,6 @@ const ChatUnanswered: FC = () => {
useHeaderStore.getState().loadActiveChats();
}, []);

useEffect(() => {
const events = sse(`/chat-list`, loadActiveChats);
return () => events.close();
}, []);

const { data: csaNameVisiblity } = useQuery<{ isVisible: boolean }>({
queryKey: ['agents/admin/name-visibility', 'prod'],
});
Expand Down
6 changes: 0 additions & 6 deletions GUI/src/pages/Chat/ValidationRequests/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { useToast } from 'hooks/useToast';
import { apiDev } from 'services/api';
import { AxiosError } from 'axios';
import { userStore as useHeaderStore } from '@buerokratt-ria/header';
import sse from 'services/sse-service';
import MessageContentView from './MessageContentView';
import { MdOutlineRemoveRedEye } from 'react-icons/md';
import { Chat as ChatType } from 'types/chat';
Expand Down Expand Up @@ -52,11 +51,6 @@ const ValidationRequests: React.FC = () => {
useHeaderStore.getState().loadValidationMessages();
}, []);

useEffect(() => {
const events = sse(`/chat-list`, loadValidationMessages);
return () => events.close();
}, []);

const approveMessage = useMutation({
mutationFn: (data: { chatId: string; messageId: string }) => {
return apiDev.post(`chats/messages/approve-validation`, {
Expand Down

0 comments on commit ee03278

Please sign in to comment.