Skip to content

Commit

Permalink
Fix devices error (wulkano#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
karaggeorge authored and sindresorhus committed Jun 14, 2019
1 parent 9684fc8 commit 3e1db67
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions main/common/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const store = new Store({
}
});

module.exports = store;

store.set('cropper', {});
store.set('actionBar', {});

Expand All @@ -90,12 +92,16 @@ const audioInputDeviceId = store.get('audioInputDeviceId');
(async () => {
const devices = await audioDevices();

if (!Array.isArray(devices)) {
const Sentry = require('../utils/sentry');
Sentry.captureException(new Error(`devices is not an array: ${JSON.stringify(devices)}`));
return;
}

if (!devices.some(device => device.id === audioInputDeviceId)) {
const [device] = devices;
if (device) {
store.set('audioInputDeviceId', device.id);
}
}
})();

module.exports = store;

0 comments on commit 3e1db67

Please sign in to comment.