Skip to content

Commit f2d88f3

Browse files
committed
fix(risk-warning): handle approve promise rejection
1 parent cb5332b commit f2d88f3

File tree

1 file changed

+9
-7
lines changed
  • packages/web3-providers/src/RiskWarning

1 file changed

+9
-7
lines changed

packages/web3-providers/src/RiskWarning/index.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ const BASE_URL = BASE_URL_MAP[process.env.NODE_ENV]
88

99
export class RiskWarning {
1010
static async approve(address: string, pluginID = '') {
11-
await fetch(`${BASE_URL}/v1/risk_warning/confirm`, {
12-
method: 'POST',
13-
body: JSON.stringify({
14-
address,
15-
plugin_id: pluginID,
16-
}),
17-
})
11+
try {
12+
await fetch(`${BASE_URL}/v1/risk_warning/confirm`, {
13+
method: 'POST',
14+
body: JSON.stringify({
15+
address,
16+
plugin_id: pluginID,
17+
}),
18+
})
19+
} catch {}
1820
}
1921
}

0 commit comments

Comments
 (0)