Commit 9cc44ded authored by haiyoucuv's avatar haiyoucuv

init

parent 661ddea5
......@@ -29,12 +29,13 @@ export class BubbleMgr extends Base {
if (!bubbleRecords?.length) return;
const bubbles = bubbleRecords.slice(0, 4);
const newBubbleKeys = [];
bubbleRecords.forEach((info) => newBubbleKeys.push(info.id));
bubbles.forEach((info) => newBubbleKeys.push(info.id));
// 找到bubbleArr中不在newBubbleKeys中的bubble
this.bubbleArr.forEach((bubble, i) => {
if (i >= 4) return;
if (bubble && !newBubbleKeys.includes(bubble.id)) {
bubble.destroy();
this.bubbleArr[i] = null;
......@@ -43,7 +44,7 @@ export class BubbleMgr extends Base {
});
// 更新数据
bubbleRecords.forEach((info, index) => {
bubbles.forEach((info, index) => {
const { id } = info;
let bubble = this.bubbleMap.get(id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment