优化缓存命中
This commit is contained in:
@@ -170,6 +170,15 @@ function clearTempBubble() {
|
||||
tempEls.forEach(function(el) { el.remove(); });
|
||||
}
|
||||
|
||||
function showTempBubble(text) {
|
||||
clearTempBubble();
|
||||
var tempId = 'temp_' + Date.now();
|
||||
var tempMsg = { id: tempId, user: '小财', text: text, attachments: [], timestamp: '', isTemp: true };
|
||||
Store.messageCache.push(tempMsg);
|
||||
messagesContainer.insertAdjacentHTML('beforeend', renderMessageHTML(tempMsg));
|
||||
scrollToBottom();
|
||||
}
|
||||
|
||||
// 双指缩放 + 拖拽
|
||||
function initPinchZoom(img) {
|
||||
var scale = 1, startDist = 0, startScale = 1;
|
||||
|
||||
@@ -19,6 +19,8 @@ function initWebSocket() {
|
||||
const room = Store.rooms.find(r => r.id === data.room_preview.room_id);
|
||||
if (room) { room.last_message = data.room_preview.last_message; room.last_time = data.room_preview.last_time; renderChatList(); }
|
||||
}
|
||||
} else if (data.type === 'query_pending') {
|
||||
if (Store.currentRoom === roomId) showTempBubble(data.text);
|
||||
} else if (data.type === 'purchase_updated') {
|
||||
if (Store.currentRoom) loadPurchases();
|
||||
updateSummaryPreview();
|
||||
|
||||
Reference in New Issue
Block a user