@@ -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 ();
@@ -138,7 +137,6 @@ function resetStates() {
138137 queryString .value = cveListSearchStore .query = ' ' ;
139138 errorMessageStore .$reset ();
140139 cveListSearchStore .isSearchButtonDisabled = true ;
141- prevSearchValue .value = ' ' ;
142140}
143141
144142function startSearch () {
@@ -163,10 +161,6 @@ function validateQueryString() {
163161 const isSearch = searchTypeBoolean .value ;
164162 const searchValue = isSearch ? queryString .value : cveId;
165163
166- // The previous search value is only used in determining whether to enable
167- // the search (see its usage in onInputChange() below).
168-
169- prevSearchValue .value = searchValue;
170164 cveListSearchStore .isSearchButtonDisabled = true ;
171165 errorMessageStore .$reset ();
172166
@@ -259,8 +253,7 @@ function onInputChange() {
259253 } else if (! allValidCharacters (searchValue)) {
260254 cveListSearchStore .isSearchButtonDisabled = true ;
261255 }
262- else if (cveListSearchStore .isSearchButtonDisabled
263- && prevSearchValue .value !== searchValue) {
256+ else if (cveListSearchStore .isSearchButtonDisabled ) {
264257 errorMessageStore .$reset ();
265258 cveListSearchStore .isSearchButtonDisabled = false ;
266259 }
@@ -323,10 +316,7 @@ function allValidCharacters(searchString) {
323316function resetSearch () {
324317
325318 // This function performs some reset tasks for the search that are
326- // common. This includes clearing the previous search value and
327- // making sure the URL is cleared of any search parameters.
328-
329- prevSearchValue .value = ' ' ;
319+ // common. This makes sure the URL is cleared of any search parameters.
330320
331321 if (route .name != ' home' || route .query )
332322 router .push ({name: ' home' , query: {}});
0 commit comments