Skip to content

Commit

Permalink
Merge pull request #733 from baha-a/fix-new-findings-3
Browse files Browse the repository at this point in the history
Fixes and enhancements in the header part
  • Loading branch information
KlviG authored Jun 20, 2024
2 parents 58121fa + e6df40c commit 57af8b3
Show file tree
Hide file tree
Showing 8 changed files with 7 additions 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.6",
"@buerokratt-ria/header": "^0.1.9",
"@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
1 change: 1 addition & 0 deletions GUI/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"search": "Search",
"notification": "Notification",
"notificationError": "Error",
"notificationErrorMsg": "An error occurred",
"active": "Active",
"activate": "Activate",
"deactivate": "Deactivate",
Expand Down
1 change: 1 addition & 0 deletions GUI/translations/et/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"search": "Otsi",
"notification": "Teade",
"notificationError": "Veateade",
"notificationErrorMsg": "Midagi läks valesti",
"active": "Aktiivne",
"activate": "Aktiveeri",
"deactivate": "Deaktiveeri",
Expand Down

0 comments on commit 57af8b3

Please sign in to comment.