mirror of
https://github.com/mastodon/mastodon
synced 2024-12-01 00:08:21 +09:00
overshadow requirement for remote-lookup
This commit is contained in:
parent
44fad0160f
commit
6cdcac1396
@ -44,7 +44,7 @@ const Lightbox = React.createClass({
|
||||
|
||||
componentDidMount () {
|
||||
this._listener = e => {
|
||||
if (e.key === 'Escape') {
|
||||
if (this.props.isVisible && e.key === 'Escape') {
|
||||
this.props.onCloseClicked();
|
||||
}
|
||||
};
|
||||
|
@ -104,6 +104,29 @@ const Modal = React.createClass({
|
||||
this.props.onPrevClicked();
|
||||
},
|
||||
|
||||
componentDidMount () {
|
||||
this._listener = e => {
|
||||
if (!this.props.isVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch(e.key) {
|
||||
case 'ArrowLeft':
|
||||
this.props.onPrevClicked();
|
||||
break;
|
||||
case 'ArrowRight':
|
||||
this.props.onNextClicked();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('keyup', this._listener);
|
||||
},
|
||||
|
||||
componentDidUnmount () {
|
||||
window.removeEventListener('keyup', this._listener);
|
||||
},
|
||||
|
||||
render () {
|
||||
const { media, index, ...other } = this.props;
|
||||
|
||||
|
@ -17,7 +17,7 @@ class SearchService < BaseService
|
||||
results = results.limit(limit).to_a
|
||||
results = [exact_match] + results.reject { |a| a.id == exact_match.id } if exact_match
|
||||
|
||||
if resolve && results.empty? && !domain.nil?
|
||||
if resolve && !exact_match && !domain.nil?
|
||||
results = [FollowRemoteAccountService.new.call("#{username}@#{domain}")]
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user