Skip to content

Commit c929e99

Browse files
authored
Merge pull request #164 from celenium-io/sentry-migration
Sentry migration
2 parents c8445ea + 593b1ce commit c929e99

File tree

9 files changed

+1185
-568
lines changed

9 files changed

+1185
-568
lines changed

app.vue

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<script setup>
2-
/** Vendor */
3-
import * as Sentry from "@sentry/vue"
4-
52
/** Services */
63
import Socket from "@/services/api/socket"
74
import amp from "@/services/amp"
@@ -135,22 +132,6 @@ onMounted(async () => {
135132
})
136133
}
137134
138-
if (window.location.hostname !== "localhost") {
139-
Sentry.init({
140-
dsn: "https://2801a6c0442d2b0cd4df995e4bbe45dc@newsentry.baking-bad.org/12",
141-
integrations: [
142-
Sentry.replayIntegration({
143-
maskAllText: false,
144-
blockAllMedia: false,
145-
}),
146-
],
147-
148-
// Session Replay
149-
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
150-
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
151-
})
152-
}
153-
154135
window.onbeforeunload = function () {
155136
Socket.close()
156137
}

components/modules/address/AddressOverview.vue

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ const handleSelect = (tab) => {
147147
148148
/** Pagination */
149149
const page = ref(1)
150+
const limit = 10
150151
const handleNextCondition = ref(true)
151152
const handleNext = () => {
152153
page.value += 1
@@ -332,8 +333,8 @@ const getTransactions = async () => {
332333
333334
const { data } = await fetchTxsByAddressHash({
334335
hash: props.address.hash,
335-
limit: 10,
336-
offset: (page.value - 1) * 10,
336+
limit: limit,
337+
offset: (page.value - 1) * limit,
337338
sort: sort.dir,
338339
sort_by: sort.by,
339340
status:
@@ -350,7 +351,7 @@ const getTransactions = async () => {
350351
351352
transactions.value = data.value
352353
cacheStore.current.transactions = transactions.value
353-
handleNextCondition.value = transactions.value.length < 10
354+
handleNextCondition.value = transactions.value?.length < limit
354355
355356
isRefetching.value = false
356357
}
@@ -360,14 +361,14 @@ const getMessages = async () => {
360361
361362
const { data } = await fetchMessagesByAddressHash({
362363
hash: props.address.hash,
363-
limit: 10,
364-
offset: (page.value - 1) * 10,
364+
limit: limit,
365+
offset: (page.value - 1) * limit,
365366
sort: "desc",
366367
})
367368
368369
messages.value = data.value
369370
cacheStore.current.messages = messages.value
370-
handleNextCondition.value = messages.value.length < 10
371+
handleNextCondition.value = messages.value?.length < limit
371372
372373
isRefetching.value = false
373374
}
@@ -377,15 +378,15 @@ const getBlobs = async () => {
377378
378379
const { data } = await fetchBlobsByAddressHash({
379380
hash: props.address.hash,
380-
limit: 10,
381-
offset: (page.value - 1) * 10,
381+
limit: limit,
382+
offset: (page.value - 1) * limit,
382383
sort: "desc",
383384
})
384385
385386
if (data.value?.length) {
386387
blobs.value = data.value.map((b) => ({ ...b, signer: props.address }))
387388
}
388-
handleNextCondition.value = data.value.length < 10
389+
handleNextCondition.value = data.value?.length < limit
389390
390391
isRefetching.value = false
391392
}
@@ -420,14 +421,14 @@ const getDelegations = async () => {
420421
421422
const { data } = await fetchAddressDelegations({
422423
hash: props.address.hash,
423-
limit: 10,
424-
offset: (page.value - 1) * 10,
424+
limit: limit,
425+
offset: (page.value - 1) * limit,
425426
})
426427
427428
if (data.value?.length) {
428429
delegations.value = data.value
429430
}
430-
handleNextCondition.value = data.value.length < 10
431+
handleNextCondition.value = data.value?.length < limit
431432
432433
isRefetching.value = false
433434
}
@@ -437,14 +438,14 @@ const getRedelegations = async () => {
437438
438439
const { data } = await fetchAddressRedelegations({
439440
hash: props.address.hash,
440-
limit: 10,
441-
offset: (page.value - 1) * 10,
441+
limit: limit,
442+
offset: (page.value - 1) * limit,
442443
})
443444
444445
if (data.value?.length) {
445446
redelegations.value = data.value
446447
}
447-
handleNextCondition.value = data.value.length < 10
448+
handleNextCondition.value = data.value?.length < limit
448449
449450
isRefetching.value = false
450451
}
@@ -454,14 +455,14 @@ const getUndelegations = async () => {
454455
455456
const { data } = await fetchAddressUndelegations({
456457
hash: props.address.hash,
457-
limit: 10,
458-
offset: (page.value - 1) * 10,
458+
limit: limit,
459+
offset: (page.value - 1) * limit,
459460
})
460461
461462
if (data.value?.length) {
462463
undelegations.value = data.value
463464
}
464-
handleNextCondition.value = data.value.length < 10
465+
handleNextCondition.value = data.value?.length < limit
465466
466467
isRefetching.value = false
467468
}
@@ -475,14 +476,14 @@ const getGrants = async () => {
475476
476477
const { data } = await fetchAddressGrants({
477478
hash: props.address.hash,
478-
limit: 10,
479-
offset: (page.value - 1) * 10,
479+
limit: limit,
480+
offset: (page.value - 1) * limit,
480481
})
481482
482483
if (data.value?.length) {
483484
grants.value = data.value
484485
}
485-
handleNextCondition.value = data.value.length < 10
486+
handleNextCondition.value = data.value?.length < limit
486487
487488
isRefetching.value = false
488489
}
@@ -492,14 +493,14 @@ const getGranters = async () => {
492493
493494
const { data } = await fetchAddressGranters({
494495
hash: props.address.hash,
495-
limit: 10,
496-
offset: (page.value - 1) * 10,
496+
limit: limit,
497+
offset: (page.value - 1) * limit,
497498
})
498499
499500
if (data.value?.length) {
500501
granters.value = data.value
501502
}
502-
handleNextCondition.value = data.value.length < 10
503+
handleNextCondition.value = data.value?.length < limit
503504
504505
isRefetching.value = false
505506
}
@@ -513,13 +514,13 @@ const getVestings = async () => {
513514
const { data } = await fetchAddressVestings({
514515
hash: props.address.hash,
515516
showEnded: showEnded.value,
516-
limit: 10,
517-
offset: (page.value - 1) * 10,
517+
limit: limit,
518+
offset: (page.value - 1) * limit,
518519
})
519520
520521
vestings.value = data.value
521522
522-
handleNextCondition.value = data.value.length < 10
523+
handleNextCondition.value = data.value?.length < limit
523524
524525
isRefetching.value = false
525526
}

components/modules/stats/TimelineSlider.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,19 @@ const brushed = ({ selection, sourceEvent }) => {
213213
fixedX1Index = Math.floor(currentX / xBand.step())
214214
fixedX0Index = Math.floor(currentX / xBand.step())
215215
216-
fixedX0 = xBand(new Date(currentData[fixedX0Index].time).toISOString()) - padding
217-
fixedX1 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding + xBand.step()
216+
fixedX0 = xBand(new Date(currentData[fixedX0Index]?.time).toISOString()) - padding
217+
fixedX1 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding + xBand.step()
218218
}
219219
220220
if (fixedX0Index - currentIndex > 0) {
221-
fixedX0 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding
221+
fixedX0 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding
222222
setStartEndFromIndex(currentData, currentIndex, fixedX1Index)
223223
} else if (fixedX0Index - currentIndex < 0) {
224-
fixedX1 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding + xBand.step()
224+
fixedX1 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding + xBand.step()
225225
setStartEndFromIndex(currentData, fixedX0Index, currentIndex)
226226
} else {
227-
fixedX0 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding
228-
fixedX1 = xBand(new Date(currentData[currentIndex].time).toISOString()) - padding + xBand.step()
227+
fixedX0 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding
228+
fixedX1 = xBand(new Date(currentData[currentIndex]?.time).toISOString()) - padding + xBand.step()
229229
setStartEndFromIndex(currentData, currentIndex, currentIndex)
230230
}
231231
const newX0 = fixedX0

components/modules/validator/ValidatorOverview.vue

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const votes = ref([])
6262
const uptime = ref([])
6363
6464
const page = ref(1)
65+
const limit = 10
6566
const handleNextCondition = ref(true)
6667
6768
const handleNext = () => {
@@ -76,14 +77,14 @@ const getBlocks = async () => {
7677
7778
const { data } = await fetchValidatorBlocks({
7879
id: props.validator.id,
79-
limit: 10,
80-
offset: (page.value - 1) * 10,
80+
limit: limit,
81+
offset: (page.value - 1) * limit,
8182
})
8283
8384
if (data.value?.length) {
8485
blocks.value = data.value
8586
cacheStore.current.blocks = blocks.value
86-
handleNextCondition.value = blocks.value.length < 10
87+
handleNextCondition.value = blocks.value?.length < limit
8788
}
8889
8990
isRefetching.value = false
@@ -94,12 +95,12 @@ const getDelegators = async () => {
9495
9596
const { data } = await fetchValidatorDelegators({
9697
id: props.validator.id,
97-
limit: 10,
98-
offset: (page.value - 1) * 10,
98+
limit: limit,
99+
offset: (page.value - 1) * limit,
99100
})
100101
101102
delegators.value = data.value
102-
handleNextCondition.value = delegators.value.length < 10
103+
handleNextCondition.value = delegators.value?.length < limit
103104
104105
isRefetching.value = false
105106
}
@@ -109,12 +110,12 @@ const getJails = async () => {
109110
110111
const { data } = await fetchValidatorJails({
111112
id: props.validator.id,
112-
limit: 10,
113-
offset: (page.value - 1) * 10,
113+
limit: limit,
114+
offset: (page.value - 1) * limit,
114115
})
115116
116117
jails.value = data.value
117-
handleNextCondition.value = jails.value.length < 10
118+
handleNextCondition.value = jails.value?.length < limit
118119
119120
isRefetching.value = false
120121
}
@@ -124,12 +125,12 @@ const getVotes = async () => {
124125
125126
const { data } = await fetchVotesByAddressHash({
126127
hash: props.validator.delegator?.hash,
127-
limit: 10,
128-
offset: (page.value - 1) * 10,
128+
limit: limit,
129+
offset: (page.value - 1) * limit,
129130
})
130131
131132
votes.value = data.value
132-
handleNextCondition.value = votes.value.length < 10
133+
handleNextCondition.value = votes.value?.length < limit
133134
134135
isRefetching.value = false
135136
}
@@ -571,8 +572,6 @@ const handleDelegate = () => {
571572
}
572573
573574
.uptime {
574-
/* width: 10px;
575-
height: 10px; */
576575
width: 0.6rem;
577576
height: 0.6rem;
578577

nuxt.config.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import topLevelAwait from "vite-plugin-top-level-await"
55
import path from "path"
66

77
export default defineNuxtConfig({
8-
modules: ["nuxt-site-config", "@nuxtjs/robots", "@pinia/nuxt", "nuxt-og-image", "@nuxtjs/sitemap"],
8+
modules: ["nuxt-site-config", "@nuxtjs/robots", "@pinia/nuxt", "nuxt-og-image", "@nuxtjs/sitemap", "@sentry/nuxt/module"],
99

1010
site: {
1111
url: "https://celenium.io",
@@ -64,11 +64,21 @@ export default defineNuxtConfig({
6464
},
6565
},
6666

67+
sentry: {
68+
sourcemaps: {
69+
disable: true,
70+
},
71+
},
72+
6773
runtimeConfig: {
6874
public: {
6975
AMP: process.env.AMP,
7076
version: "1.20.0",
7177

78+
sentry: {
79+
dsn: process.env.SENTRY_DSN,
80+
},
81+
7282
API_MAINNET: "",
7383
API_MOCHA: "",
7484
API_ARABICA: "",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@keplr-wallet/cosmos": "^0.12.70",
3838
"@openzeppelin/merkle-tree": "^1.0.6",
3939
"@pinia/nuxt": "0.11.0",
40-
"@sentry/vue": "^8.50.0",
40+
"@sentry/nuxt": "^10.19.0",
4141
"@vueuse/core": "^10.9.0",
4242
"buffer": "^6.0.3",
4343
"codemirror": "^6.0.1",

0 commit comments

Comments
 (0)