Skip to content

Commit a82e7f7

Browse files
committed
🐛 fix error
1 parent 41c84d2 commit a82e7f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/todo/todo.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export class TodoComponent implements OnInit {
2626
this.checkField = new FormControl(false);
2727
this.checkField.valueChanges
2828
.subscribe(state => {
29-
console.log(state);
3029
this.store.dispatch(new TodoActions.ToggleAction(this.todo.id));
3130
});
3231
}
@@ -37,9 +36,10 @@ export class TodoComponent implements OnInit {
3736
}
3837

3938
updateText() {
40-
if (this.textField.valid) {
39+
if (this.textField.valid && this.editing) {
4140
const id = this.todo.id;
4241
const newText = this.textField.value;
42+
this.editing = false;
4343
this.store.dispatch(new TodoActions.UpdateAction(id, newText));
4444
}
4545
}

0 commit comments

Comments
 (0)