Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

Commit 0f60e6d

Browse files
committed
feat(composables): ⚡️ catch error if fetchVotes not working in useBackends
1 parent 0b219b9 commit 0f60e6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

composables/useBackend.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ export const useBackend = () => {
2323
* @returns {Promise<PluginVotesSummary>} PluginVotesSummary.
2424
*/
2525
async function fetchVotes(): Promise<PluginVotesSummary> {
26-
return await request("GET", "") as PluginVotesSummary;
26+
try {
27+
return await request("GET", "") as PluginVotesSummary;
28+
} catch (e) {
29+
return {};
30+
}
2731
}
2832

2933
/**

0 commit comments

Comments
 (0)