Skip to content

Commit

Permalink
webapp: start fresh when adding an inverter
Browse files Browse the repository at this point in the history
avoid picking up settings from the previously added or edited inverter
when adding a new inverter by creating a new object instance.
  • Loading branch information
schlimmchen committed Oct 31, 2024
1 parent 52a7105 commit e211f59
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions webapp/src/views/PowerLimiterAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -708,12 +708,13 @@ export default defineComponent({
return inverter.channels > 1;
},
addInverter() {
this.editInverter = {} as PowerLimiterInverterConfig;
this.editInverter.is_behind_power_meter = true;
this.editInverter.serial = this.additionalInverterSerial;
this.editStart(this.editInverter);
const newInverter = {} as PowerLimiterInverterConfig;
newInverter.is_behind_power_meter = true;
newInverter.serial = this.additionalInverterSerial;
this.editStart(newInverter);
},
editStart(inverter: PowerLimiterInverterConfig) {
this.editInverter = {} as PowerLimiterInverterConfig;
Object.assign(this.editInverter, inverter);
this.modalEdit.show();
},
Expand Down

0 comments on commit e211f59

Please sign in to comment.