displays snackbar instead of greenscreen on bad url #2439
2 changed files with 4 additions and 4 deletions
|
@ -4,6 +4,7 @@ import {
|
|||
doBlurSearchInput,
|
||||
doUpdateSearchQuery,
|
||||
doSearch,
|
||||
doToast,
|
||||
selectSearchValue,
|
||||
selectSearchSuggestions,
|
||||
selectSearchBarFocused,
|
||||
|
@ -31,6 +32,7 @@ const perform = (dispatch, ownProps) => ({
|
|||
dispatch(doUpdateSearchQuery(''));
|
||||
},
|
||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||
doShowSnackBar: message => dispatch(doToast({ isError: true, message })),
|
||||
doFocus: () => dispatch(doFocusSearchInput()),
|
||||
doBlur: () => dispatch(doBlurSearchInput()),
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ type Props = {
|
|||
doFocus: () => void,
|
||||
doBlur: () => void,
|
||||
focused: boolean,
|
||||
doShowSnackBar: ({}) => void,
|
||||
doShowSnackBar: string => void,
|
||||
};
|
||||
|
||||
type State = {
|
||||
|
@ -96,9 +96,7 @@ class WunderBar extends React.PureComponent<Props, State> {
|
|||
|
||||
const query = value.trim();
|
||||
const showSnackError = () => {
|
||||
doShowSnackBar({
|
||||
message: __('Invalid LBRY URL entered. Only A-Z, a-z, 0-9, and "-" allowed.'),
|
||||
});
|
||||
doShowSnackBar('Invalid LBRY URL entered. Only A-Z, a-z, 0-9, and "-" allowed.');
|
||||
};
|
||||
|
||||
// User selected a suggestion
|
||||
|
|
Loading…
Reference in a new issue