Skip to content

Commit b1144a1

Browse files
refactor(web): address-code-rabbit-feedback
1 parent 24ac2ef commit b1144a1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

web/src/context/AtlasProvider.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const AtlasProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) =
9696
}, [authToken, address]);
9797

9898
useEffect(() => {
99-
let timeoutId: NodeJS.Timeout;
99+
let timeoutId: ReturnType<typeof setTimeout>;
100100

101101
const verifyAndSchedule = () => {
102102
// initial verfiy check
@@ -162,7 +162,7 @@ const AtlasProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) =
162162
} catch (error) {
163163
if (
164164
error instanceof AuthorizationError ||
165-
(error instanceof GraphQLError && error.extensions["code"] === "UNAUTHENTICATED")
165+
(error instanceof GraphQLError && error?.extensions["code"] === "UNAUTHENTICATED")
166166
) {
167167
setIsVerified(false);
168168
}

web/src/utils/atlas/uploadToIpfs.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export async function uploadToIpfs(config: Config, payload: IpfsUploadPayload):
4444
const error = await response.json().catch(() => ({ message: "Error uploading to IPFS" }));
4545

4646
if (response.status === 401) throw new AuthorizationError(error.message);
47-
4847
throw new Error(error.message);
4948
}
5049

@@ -64,9 +63,9 @@ export async function uploadToIpfs(config: Config, payload: IpfsUploadPayload):
6463
}
6564

6665
export class AuthorizationError extends Error {
66+
readonly name = "AuthorizationError" as const;
6767
constructor(message: string) {
6868
super(message);
69-
this.name = "AuthorizationError";
7069

7170
if (Error.captureStackTrace) {
7271
Error.captureStackTrace(this, this.constructor);

0 commit comments

Comments
 (0)