From d9d4e788010fc2d994c557b03dba5dc2796ea441 Mon Sep 17 00:00:00 2001 From: vishnukaushik Date: Sat, 21 Oct 2023 11:27:41 +0530 Subject: [PATCH] fix: #360 - return void instead of promise in preload.mediadevices-shim --- src/tab-manager/preload.mediadevices-shim.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tab-manager/preload.mediadevices-shim.js b/src/tab-manager/preload.mediadevices-shim.js index 8a33e702..0c8ace88 100644 --- a/src/tab-manager/preload.mediadevices-shim.js +++ b/src/tab-manager/preload.mediadevices-shim.js @@ -26,7 +26,7 @@ const DEFAULT_SOURCES_OPTIONS = { const desktopCapturer = { // eslint-disable-next-line no-undef - getSources: opts => ipcRenderer.invoke(APP_EVENTS.desktopCapturerGetSources, opts) + getSources: async opts => ipcRenderer.invoke(APP_EVENTS.desktopCapturerGetSources, opts) }; let currentRoot = null; @@ -145,7 +145,9 @@ const NoSourcesFound = ({sources}) => sources !== null && sources.length === 0 & const Container = ({resolve, reject}) => { const [sources, setSources] = useState(null); - const updateSourcesFunction = async () => setSources(await desktopCapturer.getSources(DEFAULT_SOURCES_OPTIONS)); + const updateSourcesFunction = () => { + desktopCapturer.getSources(DEFAULT_SOURCES_OPTIONS).then(setSources); + }; useEffect(() => { setTimeout(updateSourcesFunction, sources ? 300 : 0); }, [sources]);