Added update check if using MSS or MAS builds. need help implementing

This commit is contained in:
child_duckling 2022-02-14 22:08:24 -08:00
parent 3a7b5d8655
commit 237d20ff6d
2 changed files with 20 additions and 2 deletions

View file

@ -672,6 +672,15 @@ export class BrowserWindow {
await win_autoUpdater.checkForUpdatesAndNotify() await win_autoUpdater.checkForUpdatesAndNotify()
await linux_autoUpdater.checkForUpdatesAndNotify() await linux_autoUpdater.checkForUpdatesAndNotify()
}); });
ipcMain.on('disable-update', (event) => {
// Check if using app store builds so people don't get pissy wen button go bonk
if (app.isPackaged && !process.mas || !process.windowsStore) {
event.returnValue = false
} else {
event.returnValue = true
}
})
ipcMain.on('share-menu', async (_event, url) => { ipcMain.on('share-menu', async (_event, url) => {
if (process.platform != 'darwin') return; if (process.platform != 'darwin') return;

View file

@ -656,7 +656,7 @@
<input type="checkbox" v-model="app.cfg.general.close_button_hide" switch/> <input type="checkbox" v-model="app.cfg.general.close_button_hide" switch/>
</div> </div>
</div> </div>
<div class="md-option-line"> <div class="md-option-line update-check">
<div class="md-option-segment"> <div class="md-option-segment">
{{$root.getLz('settings.option.general.updateCider')}} {{$root.getLz('settings.option.general.updateCider')}}
</div> </div>
@ -666,7 +666,7 @@
</button> </button>
</div> </div>
</div> </div>
<div class="md-option-line"> <div class="md-option-line update-check">
<div class="md-option-segment"> <div class="md-option-segment">
{{$root.getLz('settings.option.general.updateCider.branch')}}<br> {{$root.getLz('settings.option.general.updateCider.branch')}}<br>
<small>({{$root.getLz('settings.option.general.updateCider.branch.description')}})</small> <small>({{$root.getLz('settings.option.general.updateCider.branch.description')}})</small>
@ -852,6 +852,15 @@
ipcRenderer.invoke('setStoreValue', 'general.close_behavior', app.cfg.general.close_behavior); ipcRenderer.invoke('setStoreValue', 'general.close_behavior', app.cfg.general.close_behavior);
// setStoreValue does not change plugin store values somehow // setStoreValue does not change plugin store values somehow
ipcRenderer.invoke('update-store-mtt', app.cfg.general.close_behavior); ipcRenderer.invoke('update-store-mtt', app.cfg.general.close_behavior);
},
checkIfUpdateDisabled() {
if (ipcRenderer.sendSync('disable-update')) {
let updateFields = document.getElementsByClassName('update-check');
for (var i=0; i < updateFields.length; i++) {
updateFields[i].style = "opacity: 0.5; pointer-events: none;";
updateFields[i].title = "Not available on this type of build";
}
}
} }
} }
}) })