Skip to content

Commit

Permalink
allow emojis in saved search
Browse files Browse the repository at this point in the history
  • Loading branch information
lakchote committed Sep 20, 2024
1 parent f7a4aa1 commit fcc2393
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/libs/API/parameters/SaveSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {SearchQueryString} from '@components/Search/types';

type SaveSearchParams = {
jsonQuery: SearchQueryString;
name?: string;
newName?: string;
};

export default SaveSearchParams;
6 changes: 3 additions & 3 deletions src/libs/actions/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ function getOnyxLoadingData(hash: number): {optimisticData: OnyxUpdate[]; finall
return {optimisticData, finallyData};
}

function saveSearch({queryJSON, name}: {queryJSON: SearchQueryJSON; name?: string}) {
const saveSearchName = name ?? queryJSON?.inputQuery ?? '';
function saveSearch({queryJSON, newName}: {queryJSON: SearchQueryJSON; newName?: string}) {
const saveSearchName = newName ?? queryJSON?.inputQuery ?? '';
const jsonQuery = JSON.stringify(queryJSON);

API.write(WRITE_COMMANDS.SAVE_SEARCH, {jsonQuery, name: saveSearchName});
API.write(WRITE_COMMANDS.SAVE_SEARCH, {jsonQuery, newName: saveSearchName});
}

function deleteSavedSearch(hash: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search/SavedSearchRenamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function SavedSearchRenamePage({route}: {route: {params: {q: string; name: strin

SearchActions.saveSearch({
queryJSON,
name: newName,
newName,
});

applyFiltersAndNavigate();
Expand Down

0 comments on commit fcc2393

Please sign in to comment.