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