From 9c9b95741c4ec09791fbc85ae10b7b0afe1831c4 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 9 Sep 2020 23:23:01 -0700 Subject: [PATCH] fix: Unable to edit collection description closes #1523 --- app/scenes/CollectionEdit.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/app/scenes/CollectionEdit.js b/app/scenes/CollectionEdit.js index f44e739ee..7016d3f41 100644 --- a/app/scenes/CollectionEdit.js +++ b/app/scenes/CollectionEdit.js @@ -20,20 +20,12 @@ type Props = { @observer class CollectionEdit extends React.Component { - @observable name: string; - @observable description: string = ""; - @observable icon: string = ""; - @observable color: string = "#4E5C6E"; + @observable name: string = this.props.collection.name; + @observable description: string = this.props.collection.description; + @observable icon: string = this.props.collection.icon; + @observable color: string = this.props.collection.color || "#4E5C6E"; + @observable private: boolean = this.props.collection.private; @observable isSaving: boolean; - @observable private: boolean = false; - - componentDidMount() { - this.name = this.props.collection.name; - this.description = this.props.collection.description; - this.icon = this.props.collection.icon; - this.color = this.props.collection.color; - this.private = this.props.collection.private; - } handleSubmit = async (ev: SyntheticEvent<*>) => { ev.preventDefault();