update kit
This commit is contained in:
parent
0e1a5de76a
commit
400511d070
@ -7,7 +7,7 @@
|
|||||||
"@emotion/react": "^11.10.4",
|
"@emotion/react": "^11.10.4",
|
||||||
"@emotion/styled": "^11.10.4",
|
"@emotion/styled": "^11.10.4",
|
||||||
"@fontsource/roboto": "^4.5.8",
|
"@fontsource/roboto": "^4.5.8",
|
||||||
"@frontend/kitui": "^1.0.17",
|
"@frontend/kitui": "^1.0.87",
|
||||||
"@mui/icons-material": "^5.10.9",
|
"@mui/icons-material": "^5.10.9",
|
||||||
"@mui/material": "^5.10.10",
|
"@mui/material": "^5.10.10",
|
||||||
"@mui/styled-engine-sc": "^5.10.6",
|
"@mui/styled-engine-sc": "^5.10.6",
|
||||||
|
@ -22,6 +22,7 @@ import {
|
|||||||
createTicket,
|
createTicket,
|
||||||
throttle,
|
throttle,
|
||||||
makeRequest,
|
makeRequest,
|
||||||
|
TicketMessage,
|
||||||
} from "@frontend/kitui";
|
} from "@frontend/kitui";
|
||||||
|
|
||||||
import ChatMessage from "./ChatMessage";
|
import ChatMessage from "./ChatMessage";
|
||||||
@ -37,6 +38,7 @@ import {
|
|||||||
|
|
||||||
import { SendIcon } from "../../assets/Icons/SendIcon";
|
import { SendIcon } from "../../assets/Icons/SendIcon";
|
||||||
import { UserCircleIcon } from "../../assets/Icons/UserCircleIcon";
|
import { UserCircleIcon } from "../../assets/Icons/UserCircleIcon";
|
||||||
|
import { AxiosError } from "axios";
|
||||||
|
|
||||||
interface ChatProps {
|
interface ChatProps {
|
||||||
sx: SxProps<Theme>;
|
sx: SxProps<Theme>;
|
||||||
@ -62,11 +64,11 @@ export default function Chat({ sx }: ChatProps) {
|
|||||||
ticketId: sessionData?.ticketId,
|
ticketId: sessionData?.ticketId,
|
||||||
messagesPerPage,
|
messagesPerPage,
|
||||||
messageApiPage,
|
messageApiPage,
|
||||||
onNewMessages: useCallback((messages) => {
|
onSuccess: useCallback((messages) => {
|
||||||
if (chatBoxRef.current && chatBoxRef.current.scrollTop < 1) chatBoxRef.current.scrollTop = 1;
|
if (chatBoxRef.current && chatBoxRef.current.scrollTop < 1) chatBoxRef.current.scrollTop = 1;
|
||||||
addOrUpdateUnauthMessages(messages);
|
addOrUpdateUnauthMessages(messages);
|
||||||
}, []),
|
}, []),
|
||||||
onError: useCallback((error) => {
|
onError: useCallback((error: Error) => {
|
||||||
const message = getMessageFromFetchError(error);
|
const message = getMessageFromFetchError(error);
|
||||||
if (message) enqueueSnackbar(message);
|
if (message) enqueueSnackbar(message);
|
||||||
}, []),
|
}, []),
|
||||||
@ -92,7 +94,7 @@ export default function Chat({ sx }: ChatProps) {
|
|||||||
const isPreventAutoscroll = scrollBottom > chatBox.clientHeight;
|
const isPreventAutoscroll = scrollBottom > chatBox.clientHeight;
|
||||||
setUnauthIsPreventAutoscroll(isPreventAutoscroll);
|
setUnauthIsPreventAutoscroll(isPreventAutoscroll);
|
||||||
|
|
||||||
if (fetchState !== "idle") return;
|
// if (fetchState !== "idle") return;
|
||||||
|
|
||||||
if (chatBox.scrollTop < chatBox.clientHeight) {
|
if (chatBox.scrollTop < chatBox.clientHeight) {
|
||||||
incrementUnauthMessageApiPage();
|
incrementUnauthMessageApiPage();
|
||||||
@ -127,6 +129,7 @@ export default function Chat({ sx }: ChatProps) {
|
|||||||
body: {
|
body: {
|
||||||
Title: "Unauth title",
|
Title: "Unauth title",
|
||||||
Message: messageField,
|
Message: messageField,
|
||||||
|
systemError: false
|
||||||
},
|
},
|
||||||
useToken: false,
|
useToken: false,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user