Skip to content

Commit

Permalink
fix default queryJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
lakchote committed Sep 13, 2024
1 parent 393664f commit 8b4f4e0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/pages/Search/SavedSearchRenamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import FormProvider from '@components/Form/FormProvider';
import InputWrapper from '@components/Form/InputWrapper';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import type {SearchQueryJSON} from '@components/Search/types';
import TextInput from '@components/TextInput';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -30,10 +31,7 @@ function SavedSearchRenamePage({route}: {route: {params: {q: string; name: strin
};

const onSaveSearch = () => {
const queryJSON = SearchUtils.buildSearchQueryJSON(q || SearchUtils.buildCannedSearchQuery());
if (!queryJSON) {
return;
}
const queryJSON = SearchUtils.buildSearchQueryJSON(q || SearchUtils.buildCannedSearchQuery()) ?? ({} as SearchQueryJSON);

SearchActions.saveSearch({
queryJSON,
Expand Down

0 comments on commit 8b4f4e0

Please sign in to comment.