From 2f72796ae72af4ebdae99d497150faf5bb4efecd Mon Sep 17 00:00:00 2001 From: Stephan Raab Date: Mon, 8 Apr 2024 22:17:24 +0200 Subject: [PATCH 1/3] Fix share cancel button in element-desktop --- src/vector/platform/ElectronPlatform.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index fdb46bb0eb..b7a1be1bbe 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -170,7 +170,12 @@ export default class ElectronPlatform extends VectorBasePlatform { window.electron.on("openDesktopCapturerSourcePicker", () => { const { finished } = Modal.createDialog(DesktopCapturerSourcePicker); finished.then(([source]) => { - if (!source) return; + if (!source) + source = { + id: "", + name: "", + thumbnailURL: "" + }; this.ipc.call("callDisplayMediaCallback", source); }); }); From 1cf08423adb0ef5fe583f8e6a32da6f5d5622af8 Mon Sep 17 00:00:00 2001 From: Stephan Raab Date: Tue, 9 Apr 2024 20:05:03 +0200 Subject: [PATCH 2/3] ElectronPlatform.tsx aktualisieren Co-authored-by: Robin --- src/vector/platform/ElectronPlatform.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index b7a1be1bbe..4e7ee27447 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -170,13 +170,7 @@ export default class ElectronPlatform extends VectorBasePlatform { window.electron.on("openDesktopCapturerSourcePicker", () => { const { finished } = Modal.createDialog(DesktopCapturerSourcePicker); finished.then(([source]) => { - if (!source) - source = { - id: "", - name: "", - thumbnailURL: "" - }; - this.ipc.call("callDisplayMediaCallback", source); + this.ipc.call("callDisplayMediaCallback", source ?? { id: "", name: "", thumbnailURL: "" }); }); }); From 2cad731f234ec9c4628215c55e78199158d16860 Mon Sep 17 00:00:00 2001 From: Stephan Raab Date: Tue, 9 Apr 2024 20:32:11 +0200 Subject: [PATCH 3/3] Added comment --- src/vector/platform/ElectronPlatform.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 4e7ee27447..9063fc945d 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -170,6 +170,7 @@ export default class ElectronPlatform extends VectorBasePlatform { window.electron.on("openDesktopCapturerSourcePicker", () => { const { finished } = Modal.createDialog(DesktopCapturerSourcePicker); finished.then(([source]) => { + // getDisplayMedia promise does not return if no dummy is passed here as source this.ipc.call("callDisplayMediaCallback", source ?? { id: "", name: "", thumbnailURL: "" }); }); });