]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Disable list title validation button when list title is empty
authorThibG <thib@sitedethib.com>
Sat, 3 Aug 2019 17:10:39 +0000 (19:10 +0200)
committerThibaut Girka <thib@sitedethib.com>
Mon, 5 Aug 2019 11:22:27 +0000 (13:22 +0200)
Port 089c6410208d294e7f1995e000bd796d4625246f to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js
app/javascript/flavours/glitch/features/lists/components/new_list_form.js

index 24aaf82ac18760fda3a9579d5553c355a2510edc..bf5a8de3578d1fb9ba23fd9e7a12ac9f79a0813c 100644 (file)
@@ -11,7 +11,7 @@ const messages = defineMessages({
 
 const mapStateToProps = state => ({
   value: state.getIn(['listEditor', 'title']),
-  disabled: !state.getIn(['listEditor', 'isChanged']),
+  disabled: !state.getIn(['listEditor', 'isChanged']) || !state.getIn(['listEditor', 'title']),
 });
 
 const mapDispatchToProps = dispatch => ({
index 61fcbeaf977e06dc65cac9853d0d6d17e28d22ce..eb5b6188aca7e1968db0a4123c018da96dc4243f 100644 (file)
@@ -66,7 +66,7 @@ export default class NewListForm extends React.PureComponent {
         </label>
 
         <IconButton
-          disabled={disabled}
+          disabled={disabled || !value}
           icon='plus'
           title={title}
           onClick={this.handleClick}