Browse Source

Do not show drag&drop dialog when not logined (#20400)

* Cannot upload until login

* and do not fire upload

* change username props to context
closed-social-glitch-2
Cutls 2 years ago
committed by GitHub
parent
commit
553b169d48
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/javascript/mastodon/features/ui/index.js

+ 2
- 2
app/javascript/mastodon/features/ui/index.js View File

@ -290,7 +290,7 @@ class UI extends React.PureComponent {
this.dragTargets.push(e.target); this.dragTargets.push(e.target);
} }
if (e.dataTransfer && Array.from(e.dataTransfer.types).includes('Files') && this.props.canUploadMore) {
if (e.dataTransfer && Array.from(e.dataTransfer.types).includes('Files') && this.props.canUploadMore && this.context.identity.signedIn) {
this.setState({ draggingOver: true }); this.setState({ draggingOver: true });
} }
} }
@ -318,7 +318,7 @@ class UI extends React.PureComponent {
this.setState({ draggingOver: false }); this.setState({ draggingOver: false });
this.dragTargets = []; this.dragTargets = [];
if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore) {
if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore && this.context.identity.signedIn) {
this.props.dispatch(uploadCompose(e.dataTransfer.files)); this.props.dispatch(uploadCompose(e.dataTransfer.files));
} }
} }

Loading…
Cancel
Save