This commit is contained in:
Andras Schmelczer 2026-05-31 09:39:34 +01:00
parent ad7968dadd
commit 5bf8e752e7
22 changed files with 81 additions and 112 deletions

View file

@ -138,12 +138,14 @@ export class TowerSettingsComponent implements OnInit {
onSubmit(): void {
// Only the create flow reaches here via its Submit button; edit mode
// auto-saves (and Enter on the single field is a harmless redundant save).
if (this.form.invalid) return;
this.emitSave();
this.tryEmitSave();
}
/** Emit a save only when the form is valid (skips e.g. an empty name). */
private autoSave(): void {
this.tryEmitSave();
}
private tryEmitSave(): void {
if (this.form.invalid) return;
this.emitSave();
}