take 2
Fixing up per Sean's recommendations
This commit is contained in:
parent
2707210744
commit
9b1797c1ab
2 changed files with 5 additions and 7 deletions
|
@ -7,6 +7,7 @@ import {
|
||||||
doFocusSearchInput,
|
doFocusSearchInput,
|
||||||
doBlurSearchInput,
|
doBlurSearchInput,
|
||||||
doSearch,
|
doSearch,
|
||||||
|
doNotify,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import * as settings from 'constants/settings';
|
import * as settings from 'constants/settings';
|
||||||
|
@ -38,6 +39,7 @@ const perform = dispatch => ({
|
||||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||||
doFocus: () => dispatch(doFocusSearchInput()),
|
doFocus: () => dispatch(doFocusSearchInput()),
|
||||||
doBlur: () => dispatch(doBlurSearchInput()),
|
doBlur: () => dispatch(doBlurSearchInput()),
|
||||||
|
doShowSnackBar: (modal, props) => dispatch(doNotify(modal, props)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { normalizeURI, SEARCH_TYPES, doNotify, isURIValid } from 'lbry-redux';
|
import { normalizeURI, SEARCH_TYPES, isURIValid } from 'lbry-redux';
|
||||||
import Icon from 'component/common/icon';
|
import Icon from 'component/common/icon';
|
||||||
import { parseQueryParams } from 'util/query_params';
|
import { parseQueryParams } from 'util/query_params';
|
||||||
import * as icons from 'constants/icons';
|
import * as icons from 'constants/icons';
|
||||||
|
@ -106,12 +106,10 @@ class WunderBar extends React.PureComponent<Props> {
|
||||||
const uri = normalizeURI(query);
|
const uri = normalizeURI(query);
|
||||||
onSubmit(uri, params);
|
onSubmit(uri, params);
|
||||||
} else {
|
} else {
|
||||||
window.app.store.dispatch(
|
this.props.doShowSnackBar({
|
||||||
doNotify({
|
|
||||||
message: __('Invalid LBRY URL requested. Only A-Z, a-z, and - allowed.'),
|
message: __('Invalid LBRY URL requested. Only A-Z, a-z, and - allowed.'),
|
||||||
displayType: ['snackbar'],
|
displayType: ['snackbar'],
|
||||||
})
|
})
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,12 +124,10 @@ class WunderBar extends React.PureComponent<Props> {
|
||||||
const params = getParams();
|
const params = getParams();
|
||||||
onSubmit(uri, params);
|
onSubmit(uri, params);
|
||||||
} else {
|
} else {
|
||||||
window.app.store.dispatch(
|
this.props.doShowSnackBar({
|
||||||
doNotify({
|
|
||||||
message: __('Invalid LBRY URL entered. Only A-Z, a-z, and - allowed.'),
|
message: __('Invalid LBRY URL entered. Only A-Z, a-z, and - allowed.'),
|
||||||
displayType: ['snackbar'],
|
displayType: ['snackbar'],
|
||||||
})
|
})
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
onSearch(query, resultCount);
|
onSearch(query, resultCount);
|
||||||
|
|
Loading…
Add table
Reference in a new issue