Skip to content

Commit 77f6dab

Browse files
committed
cveRecordSearchModule: remove prevSearchValue - no longer required
1 parent 685077e commit 77f6dab

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();
@@ -138,7 +137,6 @@ function resetStates() {
138137
queryString.value = cveListSearchStore.query = '';
139138
errorMessageStore.$reset();
140139
cveListSearchStore.isSearchButtonDisabled = true;
141-
prevSearchValue.value = '';
142140
}
143141
144142
function 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) {
323316
function 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

Comments
 (0)