Skip to content

Commit

Permalink
improved updater
Browse files Browse the repository at this point in the history
  • Loading branch information
alex9849 committed Nov 18, 2023
1 parent 9e5be32 commit bd0df94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ public void performUpdate() {
if(!cuResult.isUpdateAvailable()) {
throw new IllegalStateException("No update available!");
}
if(isDemoMode) {
throw new IllegalArgumentException("Can't update in demomode!");
}
String stringPath = SystemService.class.getProtectionDomain().getCodeSource().getLocation().getPath();
stringPath = URLDecoder.decode(stringPath, StandardCharsets.UTF_8);
stringPath = stringPath.substring(0, stringPath.lastIndexOf(".jar") + 4);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/CSettingsUpdater.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
color="info"
:icon="mdiUpdate()"
label="Check for update"
@click="checkUpdate"
@click="onCheckUpdate"
:loading="searchUpdate"
/>
</div>
Expand Down Expand Up @@ -143,7 +143,7 @@ export default {
mdiUpdate () {
return mdiUpdate
},
checkUpdate () {
onCheckUpdate () {
this.searchUpdate = true
this.errorMsg = ''
this.updateCandidate = ''
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/store/modules/updater/actions.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import SystemService from 'src/services/system.service'

export const performUpdate = async ({ commit }) => {
await SystemService.getCheckUpdate(true)
try {
SystemService.performUpdate()
await SystemService.performUpdate()
} catch (e) {
if (e.response.status !== 504) {
throw e
Expand Down

0 comments on commit bd0df94

Please sign in to comment.