mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix: toast not appearing when search results null
This commit is contained in:
@@ -98,20 +98,19 @@ export const Container = ({
|
||||
data[0].data ? db.notes.all : data,
|
||||
text,
|
||||
);
|
||||
|
||||
if (!searchResults && searchResults.length < 0) {
|
||||
ToastEvent.show('No search results found', 'error', 3000, () => {}, '');
|
||||
if (!searchResult || searchResult.length === 0) {
|
||||
ToastEvent.show('No search results found for ' + text, 'error');
|
||||
return;
|
||||
} else {
|
||||
dispatch({
|
||||
type: ACTIONS.SEARCH_RESULTS,
|
||||
results: {
|
||||
type,
|
||||
results: searchResult,
|
||||
keyword: text,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: ACTIONS.SEARCH_RESULTS,
|
||||
results: {
|
||||
type,
|
||||
results: searchResult,
|
||||
keyword: text,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const onBlur = () => {
|
||||
|
||||
Reference in New Issue
Block a user