mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-04 14:03:27 +00:00
Compare commits
2 Commits
v5.4.3
...
auto-updat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ad74081c4 | ||
|
|
6163ad85e0 |
@@ -30,7 +30,9 @@ function appUpdater(updateFromMenu = false) {
|
|||||||
autoUpdater.logger = log;
|
autoUpdater.logger = log;
|
||||||
|
|
||||||
// Handle auto updates for beta/pre releases
|
// Handle auto updates for beta/pre releases
|
||||||
autoUpdater.allowPrerelease = ConfigUtil.getConfigItem('betaUpdate') || false;
|
const isBetaUpdate = ConfigUtil.getConfigItem('betaUpdate');
|
||||||
|
|
||||||
|
autoUpdater.allowPrerelease = isBetaUpdate || false;
|
||||||
|
|
||||||
const eventsListenerRemove = ['update-available', 'update-not-available'];
|
const eventsListenerRemove = ['update-available', 'update-not-available'];
|
||||||
autoUpdater.on('update-available', info => {
|
autoUpdater.on('update-available', info => {
|
||||||
|
|||||||
@@ -161,7 +161,9 @@ app.on('ready', () => {
|
|||||||
|
|
||||||
page.once('did-frame-finish-load', () => {
|
page.once('did-frame-finish-load', () => {
|
||||||
// Initate auto-updates on MacOS and Windows
|
// Initate auto-updates on MacOS and Windows
|
||||||
appUpdater();
|
if (ConfigUtil.getConfigItem('autoUpdate')) {
|
||||||
|
appUpdater();
|
||||||
|
}
|
||||||
crashHandler();
|
crashHandler();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ class ServerManagerView {
|
|||||||
startMinimized: false,
|
startMinimized: false,
|
||||||
enableSpellchecker: true,
|
enableSpellchecker: true,
|
||||||
showNotification: true,
|
showNotification: true,
|
||||||
|
autoUpdate: true,
|
||||||
betaUpdate: false,
|
betaUpdate: false,
|
||||||
silent: false,
|
silent: false,
|
||||||
lastActiveTab: 0,
|
lastActiveTab: 0,
|
||||||
|
|||||||
@@ -48,7 +48,11 @@ class GeneralSection extends BaseSection {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="title">App Updates</div>
|
<div class="title">App Updates</div>
|
||||||
<div class="settings-card">
|
<div class="settings-card">
|
||||||
|
<div class="setting-row" id="autoupdate-option">
|
||||||
|
<div class="setting-description">Enable auto updates</div>
|
||||||
|
<div class="setting-control"></div>
|
||||||
|
</div>
|
||||||
<div class="setting-row" id="betaupdate-option">
|
<div class="setting-row" id="betaupdate-option">
|
||||||
<div class="setting-description">Get beta updates</div>
|
<div class="setting-description">Get beta updates</div>
|
||||||
<div class="setting-control"></div>
|
<div class="setting-control"></div>
|
||||||
@@ -104,7 +108,8 @@ class GeneralSection extends BaseSection {
|
|||||||
this.updateTrayOption();
|
this.updateTrayOption();
|
||||||
this.updateBadgeOption();
|
this.updateBadgeOption();
|
||||||
this.updateSilentOption();
|
this.updateSilentOption();
|
||||||
this.updateUpdateOption();
|
this.autoUpdateOption();
|
||||||
|
this.betaUpdateOption();
|
||||||
this.updateSidebarOption();
|
this.updateSidebarOption();
|
||||||
this.updateStartAtLoginOption();
|
this.updateStartAtLoginOption();
|
||||||
this.updateResetDataOption();
|
this.updateResetDataOption();
|
||||||
@@ -160,14 +165,26 @@ class GeneralSection extends BaseSection {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUpdateOption() {
|
autoUpdateOption() {
|
||||||
|
this.generateSettingOption({
|
||||||
|
$element: document.querySelector('#autoupdate-option .setting-control'),
|
||||||
|
value: ConfigUtil.getConfigItem('autoUpdate', true),
|
||||||
|
clickHandler: () => {
|
||||||
|
const newValue = !ConfigUtil.getConfigItem('autoUpdate');
|
||||||
|
ConfigUtil.setConfigItem('autoUpdate', newValue);
|
||||||
|
this.autoUpdateOption();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
betaUpdateOption() {
|
||||||
this.generateSettingOption({
|
this.generateSettingOption({
|
||||||
$element: document.querySelector('#betaupdate-option .setting-control'),
|
$element: document.querySelector('#betaupdate-option .setting-control'),
|
||||||
value: ConfigUtil.getConfigItem('betaUpdate', false),
|
value: ConfigUtil.getConfigItem('betaUpdate', false),
|
||||||
clickHandler: () => {
|
clickHandler: () => {
|
||||||
const newValue = !ConfigUtil.getConfigItem('betaUpdate');
|
const newValue = !ConfigUtil.getConfigItem('betaUpdate');
|
||||||
ConfigUtil.setConfigItem('betaUpdate', newValue);
|
ConfigUtil.setConfigItem('betaUpdate', newValue);
|
||||||
this.updateUpdateOption();
|
this.betaUpdateOption();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user