Skip to content

Commit aaf51aa

Browse files
committed
fix: selected tab in query onMounted
1 parent 949b57f commit aaf51aa

6 files changed

Lines changed: 42 additions & 0 deletions

File tree

components/modules/address/AddressOverview.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ const handleClearAllFilters = () => {
201201
202202
const searchTerm = ref("")
203203
204+
onMounted(() => {
205+
router.replace({
206+
query: {
207+
tab: activeTab.value,
208+
},
209+
})
210+
})
211+
204212
/** Parse route query */
205213
Object.keys(route.query).forEach((key) => {
206214
if (key === "page" || key === "tab") return

components/modules/block/BlockOverview.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ const getTransactions = async () => {
240240
await getTransactions()
241241
242242
onMounted(() => {
243+
router.replace({
244+
query: {
245+
tab: activeTab.value,
246+
},
247+
})
248+
243249
isBookmarked.value = !!bookmarksStore.bookmarks.blocks.find((t) => t.id === props.block.height)
244250
})
245251

components/modules/namespace/NamespaceOverview.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ if (activeTab.value === "Messages") await getMessages()
124124
await getRollups()
125125
126126
onMounted(() => {
127+
router.replace({
128+
query: {
129+
tab: activeTab.value,
130+
},
131+
})
132+
127133
isBookmarked.value = !!bookmarksStore.bookmarks.namespaces.find((t) => t.id === props.namespace.namespace_id)
128134
})
129135

components/modules/rollup/RollupOverview.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ const getNamespaces = async () => {
100100
if (activeTab.value === "Blobs") await getBlobs()
101101
if (activeTab.value === "Namespaces") await getNamespaces()
102102
103+
onMounted(() => {
104+
router.replace({
105+
query: {
106+
tab: activeTab.value,
107+
},
108+
})
109+
})
110+
103111
/** Refetch Blobs/Messages on new page */
104112
watch(
105113
() => page.value,

components/modules/tx/TxOverview.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ watch(
6060
)
6161
6262
onMounted(async () => {
63+
router.replace({
64+
query: {
65+
tab: activeTab.value,
66+
},
67+
})
68+
6369
isBookmarked.value = !!bookmarksStore.bookmarks.txs.find((t) => t.id === props.tx.hash)
6470
6571
const data = await fetchTxMessages(props.tx.hash)

components/modules/validator/ValidatorOverview.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ if (activeTab.value === "Jails") await getJails()
128128
129129
await getUptime()
130130
131+
onMounted(() => {
132+
router.replace({
133+
query: {
134+
tab: activeTab.value,
135+
},
136+
})
137+
})
138+
131139
const validatorStatus = computed(() => {
132140
let res = {
133141
name: "",

0 commit comments

Comments
 (0)