@@ -82,7 +82,6 @@ const cveRecordRouteName = 'CVERecord';
8282const legacyOptionLabel = ' Find a Test CVE Record/ID (Legacy)' ;
8383const searchOptionLabel = ' Search CVE List' ;
8484
85- let prevSearchValue = ref (' ' );
8685let queryString = ref (' ' );
8786
8887let cveGenericGlobalsStore = useGenericGlobalsStore ();
@@ -124,7 +123,6 @@ function resetStates() {
124123 queryString .value = cveListSearchStore .query = ' ' ;
125124 errorMessageStore .$reset ();
126125 cveListSearchStore .isSearchButtonDisabled = true ;
127- prevSearchValue .value = ' ' ;
128126}
129127
130128function startSearch () {
@@ -149,10 +147,6 @@ function validateQueryString() {
149147 const isSearch = searchTypeBoolean .value ;
150148 const searchValue = isSearch ? queryString .value : cveId;
151149
152- // The previous search value is only used in determining whether to enable
153- // the search (see its usage in onInputChange() below).
154-
155- prevSearchValue .value = searchValue;
156150 cveListSearchStore .isSearchButtonDisabled = true ;
157151 errorMessageStore .$reset ();
158152
@@ -245,8 +239,7 @@ function onInputChange() {
245239 } else if (! allValidCharacters (searchValue)) {
246240 cveListSearchStore .isSearchButtonDisabled = true ;
247241 }
248- else if (cveListSearchStore .isSearchButtonDisabled
249- && prevSearchValue .value !== searchValue) {
242+ else if (cveListSearchStore .isSearchButtonDisabled ) {
250243 errorMessageStore .$reset ();
251244 cveListSearchStore .isSearchButtonDisabled = false ;
252245 }
@@ -309,10 +302,7 @@ function allValidCharacters(searchString) {
309302function resetSearch () {
310303
311304 // This function performs some reset tasks for the search that are
312- // common. This includes clearing the previous search value and
313- // making sure the URL is cleared of any search parameters.
314-
315- prevSearchValue .value = ' ' ;
305+ // common. This makes sure the URL is cleared of any search parameters.
316306
317307 if (route .name != ' home' || route .query )
318308 router .push ({name: ' home' , query: {}});
0 commit comments