add shop result counter into response
This commit is contained in:
@@ -414,9 +414,33 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
removeThinkSpansOnly(container);
|
||||
}
|
||||
|
||||
function deduplicateRetriexMetaCards(container) {
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
|
||||
const cards = Array.from(container.querySelectorAll('.retriex-meta-card[data-retriex-meta-id]'));
|
||||
const latestCardById = new Map();
|
||||
|
||||
cards.forEach((card) => {
|
||||
latestCardById.set(card.getAttribute('data-retriex-meta-id'), card);
|
||||
});
|
||||
|
||||
cards.forEach((card) => {
|
||||
const cardId = card.getAttribute('data-retriex-meta-id');
|
||||
|
||||
if (latestCardById.get(cardId) !== card) {
|
||||
card.remove();
|
||||
}
|
||||
});
|
||||
|
||||
cleanupEmptyBlocks(container);
|
||||
}
|
||||
|
||||
function renderBubbleContent(bubble, raw) {
|
||||
bubble.innerHTML = renderMarkdown(raw);
|
||||
cleanupThinkSpans(bubble);
|
||||
deduplicateRetriexMetaCards(bubble);
|
||||
enhanceChatLinks(bubble);
|
||||
scrollChatToBottom();
|
||||
}
|
||||
@@ -495,6 +519,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
clearScheduledRender();
|
||||
bubble.innerHTML = renderMarkdown(raw);
|
||||
removeThinkSpansOnly(bubble);
|
||||
deduplicateRetriexMetaCards(bubble);
|
||||
bubble.classList.remove('loader');
|
||||
enhanceChatLinks(bubble);
|
||||
scrollChatToBottom();
|
||||
|
||||
Reference in New Issue
Block a user