Skip to content

Commit 05f3782

Browse files
committed
fix lint
1 parent c4c3f6c commit 05f3782

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/App.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ import type {
2121
PendingAny,
2222
} from "./utils/types.ts";
2323

24-
declare global {
25-
interface Window {
26-
__PORTO__?: unknown;
27-
}
28-
}
29-
3024
export function App() {
3125
useEffect(() => {
3226
if (!window.__PORTO__) {

src/utils/helpers.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ export const api = async <T = unknown>(
4545
"Content-Type": "application/json",
4646
};
4747

48-
const token =
49-
typeof window !== "undefined" && (window as any).__SESSION_TOKEN__
50-
? String((window as any).__SESSION_TOKEN__)
51-
: null;
48+
const token = typeof window !== "undefined" ? window.__SESSION_TOKEN__ : undefined;
5249

5350
if (token) {
5451
headers["X-Session-Token"] = token;

src/utils/types.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
import type { TransactionRequest } from "viem";
22

3+
declare global {
4+
interface Window {
5+
__PORTO__?: unknown;
6+
__SESSION_TOKEN__?: string;
7+
}
8+
9+
interface WindowEventMap {
10+
"eip6963:announceProvider": EIP6963AnnounceProviderEvent;
11+
"eip6963:requestProvider": Event;
12+
}
13+
}
14+
315
export type EIP6963ProviderInfo = {
416
uuid: string;
517
name: string;
@@ -33,13 +45,8 @@ export interface EIP6963AnnounceProviderEvent extends CustomEvent<EIP6963Provide
3345
type: "eip6963:announceProvider";
3446
}
3547

36-
declare global {
37-
interface WindowEventMap {
38-
"eip6963:announceProvider": EIP6963AnnounceProviderEvent;
39-
"eip6963:requestProvider": Event;
40-
}
41-
}
42-
4348
export type ApiOk<T> = { status: "ok"; data: T };
49+
4450
export type ApiErr = { status: string; message?: string };
51+
4552
export type PendingAny = Record<string, unknown> & { id: string; request: TransactionRequest };

0 commit comments

Comments
 (0)