Skip to content

Commit 5b73ba9

Browse files
committed
cveRecordSearchModule: remove prevSearchValue - no longer required
1 parent edcfdeb commit 5b73ba9

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/components/cveRecordSearchModule.vue

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ const cveRecordRouteName = 'CVERecord';
8282
const legacyOptionLabel = 'Find a Test CVE Record/ID (Legacy)';
8383
const searchOptionLabel = 'Search CVE List';
8484
85-
let prevSearchValue = ref('');
8685
let queryString = ref('');
8786
8887
let 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
130128
function 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) {
309302
function 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

Comments
 (0)