Merge pull request #146 from covespace/optimize_command_show

fix log miss in history messages
This commit is contained in:
boob.yang 2023-06-02 14:08:55 +08:00 committed by GitHub
commit ac8992f4f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,10 @@ export async function historyMessages(message: {command: string, page: number},
const skip = maxCount * (message.page ? message.page : 0);
if (messageHistory.getTopic() !== TopicManager.getInstance().currentTopicId) {
await historyMessagesBase();
const historyMessageAll = await historyMessagesBase();
if (!historyMessageAll?.entries.length || historyMessageAll?.entries.length < maxCount) {
MessageHandler.sendMessage(panel, historyMessageAll!);
}
}
const historyMessage = loadTopicHistoryFromCurrentMessageHistory(skip, maxCount);