Skip to content

Commit 2f2db4d

Browse files
committed
Rollback toast error as it shows randomly
1 parent 7296a0d commit 2f2db4d

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

web/lib/api.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import {API, APIParams, APIPath} from 'common/api/schema'
22
import {typedAPICall} from 'common/util/api'
33
import {sleep} from 'common/util/time'
44
import {auth} from './firebase/users'
5-
import {APIError} from "common/api/utils";
6-
import toast from "react-hot-toast";
75

86
export async function api<P extends APIPath>(
97
path: P,
@@ -22,11 +20,7 @@ export async function api<P extends APIPath>(
2220
}
2321
}
2422

25-
return typedAPICall(path, params, auth.currentUser).catch((e) => {
26-
if (e instanceof APIError && e.code === 429) {}
27-
toast.error('Too many requests. Please try again later.')
28-
throw e
29-
})
23+
return typedAPICall(path, params, auth.currentUser)
3024
}
3125

3226
function curriedAPI<P extends APIPath>(path: P) {

0 commit comments

Comments
 (0)