Skip to content

Commit

Permalink
fix: do not clean the answer even if a link is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
krlz16 committed May 23, 2024
1 parent 771bfaa commit 5abc1ff
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/Search/CtrlSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<router-link :to="`${linkToSearch}`" class="search-address">{{ value }}</router-link>
</template>
<div v-else-if="results.length" ref="results">
<div class="title-address capitalize">Result:</div>
<template v-for="(result, i) in results">
<div v-if="result.link && result.value"
:class="{ selected: selectedResult === i+1 }"
Expand Down
4 changes: 1 addition & 3 deletions src/components/Search/SearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ export default {
this.clearSearchedResults()
},
goTo ({ type, value }) {
const link = this.getSearchLink()({ type, value })
if (!link) return
this.clearRequests()
this.getSearchLink()({ type, value })
},
setValue (value) {
this.value = value
Expand Down
3 changes: 0 additions & 3 deletions src/store/modules/search/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const clearSearchedResults = async ({ commit, dispatch, getters }) => {
}

export const updateSearchedValue = async ({ commit, dispatch, state }, value) => {
// value = String(value).replace(/[\W_]+/g, '')
if (value.match(/.rsk/)) {
try {
const address = await getAddr(value)
Expand All @@ -28,8 +27,6 @@ export const updateSearchedValue = async ({ commit, dispatch, state }, value) =>
} catch (error) {
// console.error(error.message, value)
}
} else {
value = String(value).replace(/[\W_]+/g, '')
}
const lcValue = value.toLowerCase()
value = (isHexString(value) && isTxOrBlockHash(lcValue)) ? lcValue : value
Expand Down

0 comments on commit 5abc1ff

Please sign in to comment.