mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
Disable update notifications in Snap-packaged version
This commit is contained in:
parent
b607b4c3fe
commit
aaffeb7e44
2 changed files with 16 additions and 4 deletions
|
@ -4,6 +4,15 @@ import { shell } from 'electron';
|
|||
import url from 'url';
|
||||
|
||||
export default class AutoupdateImplBase extends EventEmitter {
|
||||
supportsUpdates() {
|
||||
// If we're packaged into a Snapcraft distribution, we don't need
|
||||
// autoupdates within the app because they're handled transparently.
|
||||
if (process.env.SNAP) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Public: Set the feed URL where we retrieve update information. */
|
||||
setFeedURL(feedURL) {
|
||||
this.feedURL = feedURL;
|
||||
|
|
|
@ -89,8 +89,15 @@ export default class AutoUpdateManager extends EventEmitter {
|
|||
this.emitUpdateAvailableEvent();
|
||||
});
|
||||
|
||||
if (autoUpdater.supportsUpdates && !autoUpdater.supportsUpdates()) {
|
||||
this.setState(UnsupportedState);
|
||||
return;
|
||||
}
|
||||
|
||||
//check immediately at startup
|
||||
this.check({ hidePopups: true });
|
||||
|
||||
//check every 30 minutes
|
||||
setInterval(() => {
|
||||
if ([UpdateAvailableState, UnsupportedState].includes(this.state)) {
|
||||
console.log('Skipping update check... update ready to install, or updater unavailable.');
|
||||
|
@ -98,10 +105,6 @@ export default class AutoUpdateManager extends EventEmitter {
|
|||
}
|
||||
this.check({ hidePopups: true });
|
||||
}, 1000 * 60 * 30);
|
||||
|
||||
if (autoUpdater.supportsUpdates && !autoUpdater.supportsUpdates()) {
|
||||
this.setState(UnsupportedState);
|
||||
}
|
||||
}
|
||||
|
||||
emitUpdateAvailableEvent() {
|
||||
|
|
Loading…
Reference in a new issue