Skip to content

Commit 503780b

Browse files
Merge pull request #7081 from hotosm/fix/7078-notification-page-crash-on-search
Accept numeric values only as a search input on project list of notification
2 parents 84b83a0 + f71f5b8 commit 503780b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frontend/src/components/notifications/inboxNav.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,14 @@ export const InboxNav = (props) => {
120120
return (
121121
<ProjectSearchBox
122122
className="dib fl mr2"
123-
setQuery={setInboxQuery}
123+
setQuery={(value) => {
124+
if (!value.project) {
125+
setInboxQuery({ ...inboxQuery, project: undefined });
126+
return;
127+
}
128+
if (value.project && isNaN(value.project)) return;
129+
setInboxQuery(value);
130+
}}
124131
fullProjectsQuery={inboxQuery}
125132
placeholder={msg}
126133
searchField={'project'}

0 commit comments

Comments
 (0)