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 GitHub
parent b0755bc010
commit deffaf1ee0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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) {