@@ -198,6 +198,7 @@ export default class CollectionItem extends mixins(ChainMixin, PrefixMixin) {
198
198
protected total = 0
199
199
protected stats: NFT [] = []
200
200
protected priceData: any = []
201
+ private statsLoaded = false
201
202
202
203
get isLoading(): boolean {
203
204
return this .$apollo .queries .collection .loading
@@ -256,7 +257,6 @@ export default class CollectionItem extends mixins(ChainMixin, PrefixMixin) {
256
257
public created(): void {
257
258
this .checkId ()
258
259
this .checkActiveTab ()
259
- this .loadStats ()
260
260
this .$apollo .addSmartQuery (' collection' , {
261
261
query: collectionById ,
262
262
client: this .urlPrefix ,
@@ -297,6 +297,7 @@ export default class CollectionItem extends mixins(ChainMixin, PrefixMixin) {
297
297
.then (({ data }) => data ?.nFTEntities ?.nodes || [])
298
298
.then ((nfts ) => {
299
299
this .stats = nfts
300
+ this .statsLoaded = true
300
301
this .loadPriceData ()
301
302
})
302
303
}
@@ -353,12 +354,19 @@ export default class CollectionItem extends mixins(ChainMixin, PrefixMixin) {
353
354
354
355
@Watch (' activeTab' )
355
356
protected onTabChange(val : string , oldVal : string ): void {
356
- if (shouldUpdate (val , oldVal )) {
357
+ let queryTab = this .$route .query .tab
358
+
359
+ if (shouldUpdate (val , oldVal ) && (queryTab !== val )) {
357
360
this .$router .replace ({
358
361
path: String (this .$route .path ),
359
362
query: { tab: val },
360
363
})
361
364
}
365
+
366
+ // Load chart data once when clicked on activity tab for the first time.
367
+ if (val === ' activity' && ! this .statsLoaded ) {
368
+ this .loadStats ()
369
+ }
362
370
}
363
371
364
372
get iframeSettings(): Record <string , unknown > {
0 commit comments