From 12d35783db1bb302d7540d8d3690ab6eed3dac3b Mon Sep 17 00:00:00 2001 From: Starfall Date: Sun, 1 Mar 2020 14:49:21 -0600 Subject: Revert "Merge branch 'glitch'" Login is broken This reverts commit 22a55edc158352003a3953964c9d332a60c86428, reversing changes made to 5902299384d15249fe4b84b8761d4a49f3c7f6fd. --- .../glitch/features/compose/components/compose_form.js | 12 ++++++------ .../flavours/glitch/features/compose/components/publisher.js | 8 ++------ .../flavours/glitch/features/keyboard_shortcuts/index.js | 4 ---- 3 files changed, 8 insertions(+), 16 deletions(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index daacbb73f..6e07998ec 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -93,7 +93,7 @@ class ComposeForm extends ImmutablePureComponent { } } - handleSubmit = (overriddenVisibility = null) => { + handleSubmit = () => { const { textarea: { value }, uploadForm } = this; const { onChange, @@ -106,7 +106,6 @@ class ComposeForm extends ImmutablePureComponent { text, mediaDescriptionConfirmation, onMediaDescriptionConfirm, - onChangeVisibility, } = this.props; // If something changes inside the textarea, then we update the @@ -125,9 +124,6 @@ class ComposeForm extends ImmutablePureComponent { const firstWithoutDescription = media.find(item => !item.get('description')); onMediaDescriptionConfirm(this.context.router ? this.context.router.history : null, firstWithoutDescription.get('id')); } else if (onSubmit) { - if (onChangeVisibility && overriddenVisibility) { - onChangeVisibility(overriddenVisibility); - } onSubmit(this.context.router ? this.context.router.history : null); } } @@ -156,9 +152,13 @@ class ComposeForm extends ImmutablePureComponent { // Handles the secondary submit button. handleSecondarySubmit = () => { const { + onChangeVisibility, sideArm, } = this.props; - this.handleSubmit(sideArm === 'none' ? null : sideArm); + if (sideArm !== 'none' && onChangeVisibility) { + onChangeVisibility(sideArm); + } + this.handleSubmit(); } // Selects a suggestion from the autofill. diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.js b/app/javascript/flavours/glitch/features/compose/components/publisher.js index 97890f40d..b8d9d98bf 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.js +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.js @@ -38,12 +38,8 @@ class Publisher extends ImmutablePureComponent { sideArm: PropTypes.oneOf(['none', 'direct', 'private', 'unlisted', 'public']), }; - handleSubmit = () => { - this.props.onSubmit(); - }; - render () { - const { countText, disabled, intl, onSecondarySubmit, privacy, sideArm } = this.props; + const { countText, disabled, intl, onSecondarySubmit, onSubmit, privacy, sideArm } = this.props; const diff = maxChars - length(countText || ''); const computedClass = classNames('composer--publisher', { @@ -109,7 +105,7 @@ class Publisher extends ImmutablePureComponent { } }()} title={`${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${privacy}.short` })}`} - onClick={this.handleSubmit} + onClick={onSubmit} disabled={disabled || diff < 0} /> diff --git a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js index 0bb71e872..bc7571200 100644 --- a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js +++ b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js @@ -113,10 +113,6 @@ class KeyboardShortcuts extends ImmutablePureComponent { s - - alt+enter - - esc -- cgit