diff --git a/js/activity.js b/js/activity.js index 46be8f192c..500a626fd0 100644 --- a/js/activity.js +++ b/js/activity.js @@ -567,24 +567,27 @@ class Activity { // this.doLoadAnimation(); this.blocks.isLocalUpdate = false; - // Render the blocks - for (const name in this.palettes.dict) { - this.palettes.dict[name].hideMenu(true); - } - - this.stage.removeAllEventListeners("trashsignal"); - - // Wait for the old blocks to be removed. - // eslint-disable-next-line no-unused-vars - const __listener = (event) => { - this.blocks.loadNewBlocks(data); + setTimeout(() => { + // Render the blocks + for (const name in this.palettes.dict) { + this.palettes.dict[name].hideMenu(true); + } + this.stage.removeAllEventListeners("trashsignal"); - }; + + // Wait for the old blocks to be removed. + // eslint-disable-next-line no-unused-vars + const __listener = (event) => { + this.blocks.loadNewBlocks(data); + this.stage.removeAllEventListeners("trashsignal"); + }; + + this.stage.addEventListener("trashsignal", __listener, false); + this.sendAllToTrash(false, false); + this._allClear(false); + this.refreshCanvas(); + }, 500) - this.stage.addEventListener("trashsignal", __listener, false); - this.sendAllToTrash(false, false); - this._allClear(false); - this.refreshCanvas(); }; /** @@ -5935,10 +5938,10 @@ class Activity { if (room_id) { this.room_id = room_id; - this.textMsg(`_("Collaboration link: ") ${collabUrl}`); + this.textMsg(`${_("Collaboration link: ")} ${collabUrl}`); this._initiateCollaboration(this.room_id); }; - }, 7000); + }, 5000); /* document.addEventListener("mousewheel", scrollEvent, false); document.addEventListener("DOMMouseScroll", scrollEvent, false); diff --git a/js/collaboration/collaboration.js b/js/collaboration/collaboration.js index ed49b7b87e..8010808364 100644 --- a/js/collaboration/collaboration.js +++ b/js/collaboration/collaboration.js @@ -65,14 +65,10 @@ class Collaboration { }); socket.on("new-block-added", (update) => { - this.activity.textMsg("New block added. rendering..."); - setTimeout(this.activity.hideMsgs, 10000); this.activity.renderProjectFromData(update); }); socket.on("new-block-deleted", (update) => { - this.activity.textMsg("New block deleted. rendering..."); - setTimeout(this.activity.hideMsgs, 10000); this.activity.renderProjectFromData(update); });