catch setFeedURL for non-codesigned apps

Summary: see title

Reviewed By: jknoxville

Differential Revision: D9264748

fbshipit-source-id: 6675a27d899361e12dd752eb5feea0f85c5c8d07
This commit is contained in:
Daniel Büchele
2018-08-10 08:47:57 -07:00
committed by Facebook Github Bot
parent 6dd97f58ef
commit 7107efcc88

View File

@@ -38,9 +38,14 @@ export default class AutoUpdateVersion extends Component<{}, State> {
componentDidMount() {
if (isProduction()) {
remote.autoUpdater.setFeedURL({
url: `${config.updateServer}?version=${version}`,
});
// this will fail, if the app is not code signed
try {
remote.autoUpdater.setFeedURL({
url: `${config.updateServer}?version=${version}`,
});
} catch (e) {
console.error(e);
}
remote.autoUpdater.on('update-downloaded', () => {
this.setState({updater: 'update-downloaded'});