displays snackbar instead of greenscreen on bad url #2439

Merged
jessopb merged 1 commit from issue2431-badurlsnackbar into master 2019-04-21 20:50:59 +02:00
2 changed files with 4 additions and 4 deletions

View file

@ -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()),
});

View file

@ -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