Skip to content

Commit

Permalink
add try catch to explorer api call (#2153)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNerdi authored Mar 15, 2024
1 parent e3092d6 commit 3ce7f03
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import { get } from 'svelte/store'

export async function updateCirculatingSupplyForActiveProfile(): Promise<void> {
const $profile = get(activeProfile)
const circulatingSupply = await ExplorerApi.getCirculatingSupply($profile.network.id as StardustNetworkId)
activeProfile.update((state) => {
state.network.protocol.circulatingSupply = circulatingSupply
return state
})
try {
const circulatingSupply = await ExplorerApi.getCirculatingSupply($profile.network.id as StardustNetworkId)
activeProfile.update((state) => {
state.network.protocol.circulatingSupply = circulatingSupply
return state
})
} catch (err) {
console.error('Error updating circulating supply for active profile', err)
}
}

0 comments on commit 3ce7f03

Please sign in to comment.