diff --git a/src/renderer/components/ClusterPage.vue b/src/renderer/components/ClusterPage.vue index 9afc832902..6e1a15cb9b 100644 --- a/src/renderer/components/ClusterPage.vue +++ b/src/renderer/components/ClusterPage.vue @@ -98,29 +98,6 @@ export default { 'document.styleSheets[0].insertRule("*, *::after, *::before { -webkit-user-drag: none; -webkit-app-region: no-drag; }", 1);' ); }, - addWebview: function() { - const container = document.getElementById("lens-container"); - if (!container || !this.lens.webview) { - return - } - container.style = "display: block;" - let webview = null - container.childNodes.forEach((child) => { - if (child === this.lens.webview) { - webview = child - } - }) - if (!webview) { - container.appendChild(this.lens.webview) - } - container.childNodes.forEach((child) => { - if (child !== this.lens.webview) { - child.style = "display: none;" - } else { - child.style = "top: 0; bottom: 20px;" - } - }) - }, // Called only when online state changes toggleLens: function() { if (!this.lens) { return } @@ -138,10 +115,11 @@ export default { webview.addEventListener('did-finish-load', this.lensLoaded); webview.src = this.cluster.url; this.lens.webview = webview; - this.$store.dispatch("attachWebview", this.lens); } - this.$store.dispatch("attachWebview", this.lens); - this.$tracker.event("cluster", "open"); + setTimeout(() => { // see: https://github.com/electron/electron/issues/10016 + this.$store.dispatch("attachWebview", this.lens); + this.$tracker.event("cluster", "open"); + }, 0) }, hideLens: function() { this.$store.dispatch("hideWebviews");