Skip to content

Commit

Permalink
UI: reload on upgrade and startup error fix (#12835)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored Mar 20, 2024
1 parent fc67fdf commit 516a7ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/components/LoadpointSettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</h4>
<div v-if="phasesOptions.length" class="mb-3 row">
<label
:for="formId('phases_0')"
:for="formId(`phases_${phasesOptions[0]}`)"
class="col-sm-4 col-form-label pt-0"
>
{{ $t("main.loadpointSettings.phasesConfigured.label") }}
Expand Down
11 changes: 11 additions & 0 deletions assets/js/views/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,18 @@ export default {
const siteTitle = store.state.siteTitle;
return { title: siteTitle ? `${siteTitle} | evcc` : "evcc" };
},
watch: {
version: function (prev, now) {
if (!!prev && !!now) {
console.log("new version detected. reloading browser", { now, prev });
this.reload();
}
},
},
computed: {
version: function () {
return store.state.version;
},
batteryModalAvailabe: function () {
return store.state.battery?.length;
},
Expand Down
3 changes: 3 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ func runRoot(cmd *cobra.Command, args []string) {
go updater.Run(log, httpd, valueChan)
}

// remove previous fatal startup errors
valueChan <- util.Param{Key: "fatal", Val: nil}

// expose sponsor to UI
if sponsor.Subject != "" {
valueChan <- util.Param{Key: "sponsor", Val: sponsor.Subject}
Expand Down

0 comments on commit 516a7ee

Please sign in to comment.