Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and enhancements in the header part #733

Merged
merged 5 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.6",
"@buerokratt-ria/header": "^0.1.8",
"@buerokratt-ria/menu": "^0.1.16",
"@buerokratt-ria/styles": "^0.0.1",
"@fontsource/roboto": "^4.5.8",
Expand Down
17 changes: 1 addition & 16 deletions GUI/src/components/Chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { AUTHOR_ROLES, MESSAGE_FILE_SIZE_LIMIT, ROLES } from 'utils/constants';
import { AxiosError } from 'axios';
import { useToast } from 'hooks/useToast';
import useStore from 'store';
import useHeaderStore from '@buerokratt-ria/header/src/header/store/store';
import { userStore as useHeaderStore } from '@buerokratt-ria/header';
import sse from '../../services/sse-service';
import { useNavigate } from 'react-router-dom';
import PreviewMessage from './PreviewMessage';
Expand Down Expand Up @@ -76,24 +76,9 @@ const Chat: FC<ChatProps> = ({
const [previewTypingMessage, setPreviewTypingMessage] = useState<Message>();

useEffect(() => {
getCsaStatus();
getMessages();
}, []);

const getCsaStatus = async () => {
const { data: res } = await apiDev.post(
'accounts/customer-support-activity-by-id',
{
customerSupportId: userInfo?.idCode ?? '',
}
);
useHeaderStore
.getState()
.setChatCsaActive(
res.response.status === 'online' || res.response.status === 'idle'
);
};

useEffect(() => {
const onMessage = async (res: any) => {
if (res === 'preview') {
Expand Down
5 changes: 0 additions & 5 deletions GUI/src/hooks/useAudio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ export const useAudio = (audiosrc: string) => {
useEffect(() => {
const howl = new Howl({
src: audiosrc,
onloaderror: (soundId, error) => console.error(soundId, error),
onplayerror: (soundId, error) => {
console.error(soundId, error);
howl.once('unlock', () => howl.play());
},
});

setAudio(howl);
Expand Down
2 changes: 1 addition & 1 deletion GUI/src/pages/Chat/ChatActive/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useQuery } from '@tanstack/react-query';
import { Chat, Dialog, Button, FormRadios, Track } from 'components';
import { Chat as ChatType, CHAT_EVENTS, CHAT_STATUS } from 'types/chat';
import useStore from 'store';
import useHeaderStore from '@buerokratt-ria/header/src/header/store/store';
import { userStore as useHeaderStore } from '@buerokratt-ria/header';
import { User } from 'types/user';
import { useToast } from 'hooks/useToast';
import apiDev from 'services/api-dev';
Expand Down
2 changes: 1 addition & 1 deletion GUI/src/pages/Chat/ChatPending/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import ForwardToEstablishmentModal from '../ForwardToEstablishmentModal';
import sse from 'services/sse-service';
import { v4 as uuidv4 } from 'uuid';
import './ChatPending.scss';
import useHeaderStore from '@buerokratt-ria/header/src/header/store/store';
import { userStore as useHeaderStore } from '@buerokratt-ria/header';
import useStore from 'store';
import withAuthorization from 'hoc/with-authorization';
import { ROLES } from 'utils/constants';
Expand Down
2 changes: 1 addition & 1 deletion GUI/src/pages/Chat/ChatUnanswered/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useQuery } from '@tanstack/react-query';

import { Chat, Dialog, Button, FormRadios } from 'components';
import { CHAT_EVENTS, CHAT_STATUS, Chat as ChatType } from 'types/chat';
import useHeaderStore from '@buerokratt-ria/header/src/header/store/store';
import { userStore as useHeaderStore } from '@buerokratt-ria/header';
import useStore from 'store';
import { User } from 'types/user';
import { useToast } from 'hooks/useToast';
Expand Down