Fix cowebsite closing on fast opening/closing

This commit is contained in:
Alexis Faizeau 2022-02-08 11:19:29 +01:00
parent 7334d59c4f
commit f5f71f32ee
5 changed files with 97 additions and 155 deletions

View file

@ -10,13 +10,9 @@
function closeCoWebsite() {
if ($highlightedEmbedScreen?.type === "cowebsite") {
if ($highlightedEmbedScreen.embed.closable) {
coWebsiteManager.closeCoWebsite($highlightedEmbedScreen.embed).catch(() => {
console.error("Error during co-website highlighted closing");
});
coWebsiteManager.closeCoWebsite($highlightedEmbedScreen.embed);
} else {
coWebsiteManager.unloadCoWebsite($highlightedEmbedScreen.embed).catch(() => {
console.error("Error during co-website highlighted unloading");
});
coWebsiteManager.unloadCoWebsite($highlightedEmbedScreen.embed);
}
}
}