Skip to content

Commit

Permalink
📦 VERSION: 3.3.4
Browse files Browse the repository at this point in the history
- fix: App failing to open on first attempt
- chore: Support unlocking with the Enter key
- fix: get token balance api
  • Loading branch information
AricRedemption committed Oct 12, 2024
1 parent 6ff2ff7 commit a698e81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/lib/actions/token/get-balance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assetsManager from '../../assets'
import { getTokenBalance } from '@/lib/assets'

export async function process() {
return await assetsManager.getTokenBalance()
export async function process(_: unknown, { password }: { host: string; password: string }) {
return await getTokenBalance(password)
}
4 changes: 2 additions & 2 deletions src/lib/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export async function removeAssetsDisplay(asset: string) {
await setAccount(account)
}

export async function getTokenBalance() {
const wallet = await getCurrentWallet(Chain.MVC)
export async function getTokenBalance(password?: string) {
const wallet = await getCurrentWallet(Chain.MVC, { password })
const address = wallet.getAddress()
return await fetchMVCTokens(address)
}
Expand Down
5 changes: 1 addition & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ import { VueQueryPlugin } from '@tanstack/vue-query'
import Notification from './components/Notification.vue'

const maxRetries = 3
const retryDelay = 100

const fetchWithRetry = async (retries = maxRetries) => {
if(IS_DEV) return
if (IS_DEV) return
try {
return await notifyBg('ping')()
} catch (error) {
if (retries > 0) {
console.warn(`Request failed, retrying in ${retryDelay / 1000} seconds... Remaining retries: ${retries}`)
await new Promise((resolve) => setTimeout(resolve, retryDelay))
return fetchWithRetry(retries - 1)
} else {
console.error('Request failed, maximum retry attempts reached')
Expand Down

0 comments on commit a698e81

Please sign in to comment.