Merge pull request #294 from JsSucks/updater

add check for updates button
This commit is contained in:
Alexei Stukov 2019-03-08 15:44:16 +02:00 committed by GitHub
commit b83cdb1de7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -12,8 +12,9 @@
<SettingsWrapper headertext="Super Secret"> <SettingsWrapper headertext="Super Secret">
<div class="bd-flex bd-flexCol bd-devview"> <div class="bd-flex bd-flexCol bd-devview">
<FormButton @click="forceUpdate">Force Update</FormButton> <FormButton @click="forceUpdate">Force Update</FormButton>
<FormButton @click="debugConfig">Config Debug</FormButton> <FormButton @click="checkForUpdates">Check for Updates</FormButton>
<FormButton @click="testUpdateUi">Update UI Test</FormButton> <FormButton @click="testUpdateUi">Update UI Test</FormButton>
<FormButton @click="debugConfig">Config Debug</FormButton>
</div> </div>
</SettingsWrapper> </SettingsWrapper>
</template> </template>
@ -38,6 +39,9 @@
forceUpdate() { forceUpdate() {
ClientIPC.send('debug-updater-forceUpdate'); ClientIPC.send('debug-updater-forceUpdate');
}, },
checkForUpdates() {
ClientIPC.send('debug-updater-checkForUpdates');
},
debugConfig() { debugConfig() {
console.log(Globals); console.log(Globals);
}, },

View File

@ -84,9 +84,14 @@ export default class Updater extends Module {
clearInterval(this.updaterThread); clearInterval(this.updaterThread);
this.updateAll(updates); this.updateAll(updates);
}); });
ipc.on('debug-updater-forceUpdate', () => { ipc.on('debug-updater-forceUpdate', () => {
this.checkForUpdates(true); this.checkForUpdates(true);
}); });
ipc.on('debug-updater-checkForUpdates', () => {
this.checkForUpdates();
});
} }
async updateBd(update) { async updateBd(update) {
@ -217,7 +222,7 @@ export default class Updater extends Module {
} }
async checkForUpdates(forced = false) { async checkForUpdates(forced = false) {
console.log('[BetterDiscord:Updater] Checking for updates'); console.log('[BetterDiscord:Updater] Checking for updates', forced);
this.bd.sendToDiscord('updater-checkForUpdates', ''); this.bd.sendToDiscord('updater-checkForUpdates', '');
try { try {