Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Jicheng Lu committed Feb 29, 2024
1 parent 7a5f420 commit add7006
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
/** @type {boolean} */
let isLoadContentLog = false;
let isLoadStateLog = false;
let isContentLogClosed = false;
let isStateLogClosed = false;
let isContentLogClosed = false; // initial condition
let isStateLogClosed = false; // initial condition
let isOpenEditMsgModal = false;
let isOpenAddStateModal = false;
let isSendingMsg = false;
Expand Down Expand Up @@ -114,16 +114,8 @@
function resizeChatWindow() {
isLite = Viewport.Width <= screenWidthThreshold;
if (!isLite) {
if (isContentLogClosed) {
isLoadContentLog = false;
} else {
isLoadContentLog = true;
}
if (isStateLogClosed) {
isLoadStateLog = false;
} else {
isLoadStateLog = true;
}
isLoadContentLog = !isContentLogClosed;
isLoadStateLog = !isStateLogClosed;
} else {
isLoadContentLog = false;
isLoadStateLog = false;
Expand All @@ -132,6 +124,14 @@
}
}
function initChatView() {
isFrame = $page.url.searchParams.get('isFrame') === 'true';
// initial condition
isContentLogClosed = false;
isStateLogClosed = false;
resizeChatWindow();
}
/** @param {import('$types').ChatResponseModel[]} dialogs */
function initUserSentMessages(dialogs) {
const curConvMessages = dialogs?.filter(x => x.sender?.role != UserRole.Assistant).map(x => {
Expand Down Expand Up @@ -181,11 +181,6 @@
return messages?.slice(-messageLimit) || [];
}
function initChatView() {
isFrame = $page.url.searchParams.get('isFrame') === 'true';
resizeChatWindow();
}
/** @param {import('$types').ChatResponseModel[]} dialogs */
function findLastBotMessage(dialogs) {
const lastMsg = dialogs.slice(-1)[0];
Expand Down

0 comments on commit add7006

Please sign in to comment.