Skip to content

Commit

Permalink
fix: manusa#360 - return void instead of promise in preload.mediadevi…
Browse files Browse the repository at this point in the history
…ces-shim
  • Loading branch information
vishnukaushik committed Oct 21, 2023
1 parent 3789d6e commit d9d4e78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tab-manager/preload.mediadevices-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit d9d4e78

Please sign in to comment.