feat: Chat-History auf max. 500 Nachrichten limitieren
This commit is contained in:
1 parent
58c5ccb79b
commit
e31daa2385
4 files changed
+53
-7
No files matched your search
+11
-2
@@ -13,9 +13,18 @@ async function loadHistory() {
|
||||
}
|
||||
|
||||
const data = await apiHistory(sid);
|
||||
data.reverse();
|
||||
const entries = data.entries || [];
|
||||
entries.reverse();
|
||||
|
||||
for (const entry of data) {
|
||||
if (data.hasMore) {
|
||||
const skipped = data.totalCount - data.loadedCount;
|
||||
const info = document.createElement('div');
|
||||
info.className = 'msg system-info';
|
||||
info.innerHTML = `<i class="fa fa-info-circle"></i> ${skipped} ältere Nachrichten nicht geladen`;
|
||||
chatEl().appendChild(info);
|
||||
}
|
||||
|
||||
for (const entry of entries) {
|
||||
renderMessages(entry.messages, true);
|
||||
if (entry.chain) addChainMetaBubble(entry.chain, false);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user