Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #360 - return void instead of promise in preload.mediadevices-shim #361

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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