Every empty/comment-only catch block now logs a descriptive warning in dev mode via `if (import.meta.env.DEV) console.warn(...)`. Covers 15 files across views, stores, components, and utils. Zero silent catches remaining. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
585 B
TypeScript
19 lines
585 B
TypeScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
import { rpcClient } from '@/api/rpc-client'
|
|
|
|
export const useWeb5BadgeStore = defineStore('web5Badge', () => {
|
|
const pendingRequestCount = ref(0)
|
|
|
|
async function refresh() {
|
|
try {
|
|
const res = await rpcClient.call<{ requests: Array<{ id: string }> }>({ method: 'network.list-requests' })
|
|
pendingRequestCount.value = res.requests?.length ?? 0
|
|
} catch (e) {
|
|
if (import.meta.env.DEV) console.warn('Badge refresh failed — best-effort', e)
|
|
}
|
|
}
|
|
|
|
return { pendingRequestCount, refresh }
|
|
})
|