Skip to content

Commit

Permalink
Battery UI: fix buffer start 0 (#16676)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored Oct 16, 2024
1 parent 971ff9a commit eb36a9b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions assets/js/components/BatterySettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export default {
}
options.push({
value: 0,
name: this.$t("batterySettings.bufferStart.never"),
name: this.getBufferStartName(0),
});
return options;
},
Expand Down Expand Up @@ -489,10 +489,10 @@ export default {
console.error(err);
}
},
getBufferStartName(soc) {
return this.$t(`batterySettings.bufferStart.${soc === 100 ? "full" : "above"}`, {
soc: this.fmtSoc(soc),
});
getBufferStartName(value) {
const key = value === 0 ? "never" : value === 100 ? "full" : "above";
const soc = this.fmtSoc(value);
return this.$t(`batterySettings.bufferStart.${key}`, { soc });
},
},
};
Expand Down

0 comments on commit eb36a9b

Please sign in to comment.