Skip to content

Commit 5cf9d04

Browse files
committed
Fix fetching history messages after setting access key
1 parent f5e9dc4 commit 5cf9d04

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/views/pages/ChatPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@ const chatPanel = observer(() => {
8181
useEffect(() => {
8282
getSettings();
8383
getFeatureToggles();
84-
chat.fetchHistoryMessages({ pageIndex: 0 }).then();
8584
messageUtil.registerHandler("getUserAccessKey", (message: any) => {
8685
chat.setKey(message.accessKey);
86+
// The history records need to be obtained after setting the key,
87+
// as the display information in the history record requires adjustment
88+
// based on whether the key is present.
89+
chat.fetchHistoryMessages({ pageIndex: 0 }).then();
8790
});
8891
messageUtil.registerHandler("reloadMessage", (message: any) => {
8992
chat.reloadMessage(message);

0 commit comments

Comments
 (0)