Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 5ca4f7a

Browse files
authored
Merge pull request #2371 from prachi00/feat-search-bug
2 parents f15d227 + b3e9c49 commit 5ca4f7a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

components/rmrk/Gallery/Gallery.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
</template>
8585

8686
<script lang="ts">
87-
import { Component, mixins, Vue } from 'nuxt-property-decorator'
87+
import { Component, mixins, Vue, Watch } from 'nuxt-property-decorator'
8888
import { NftEntity as GraphNFT } from '@/components/rmrk/service/types'
8989
import {
9090
getCloudflareImageLinks,
@@ -105,6 +105,7 @@ import PrefixMixin from '~/utils/mixins/prefixMixin'
105105
import { NFTMetadata } from '../service/scheme'
106106
import { getSanitizer } from '../utils'
107107
import { SearchQuery } from './Search/types'
108+
import shouldUpdate from '~/utils/shouldUpdate'
108109
109110
type GraphResponse = NFTEntitiesWithCount<GraphNFT>
110111
@@ -279,6 +280,13 @@ export default class Gallery extends mixins(PrefixMixin) {
279280
return params
280281
}
281282
283+
@Watch('$route.query.search')
284+
protected onIdChange(val: string, oldVal: string) {
285+
if (shouldUpdate(val, oldVal)) {
286+
this.searchQuery.search = val || ''
287+
}
288+
}
289+
282290
get results() {
283291
// if (this.searchQuery) {
284292
// return basicAggQuery(expandedFilter(this.searchQuery, this.nfts))

0 commit comments

Comments
 (0)