Fix issue with empty markdown content not nulling DB. Fixes #924 (#925)

* Fix issue with empty markdown content not nulling DB. Fixes #924

* Better syntax
This commit is contained in:
Dessalines 2023-02-16 21:10:03 -05:00 committed by Dessalines
parent 4eb902306d
commit fec9200bd6

View file

@ -390,9 +390,9 @@ export class MarkdownTextArea extends Component<
}
contentChange() {
if (this.state.content) {
this.props.onContentChange?.(this.state.content);
}
// Coerces the undefineds to empty strings, for replacing in the DB
let content = this.state.content ?? "";
this.props.onContentChange?.(content);
}
handleContentChange(i: MarkdownTextArea, event: any) {