Skip to content

Commit 1981197

Browse files
authored
feat(app): switch landing redirect strategy (#2942)
2 parents 0848f4c + 320d50c commit 1981197

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

app/src/hooks.client.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { HandleClientError } from "@sveltejs/kit"
22

3+
/**
4+
* `hooks.client.{js|ts}` is a special SvelteKit file called "Shared Hooks"
5+
* @see https://kit.svelte.dev/docs/hooks#shared-hooks
6+
*/
7+
38
// biome-ignore lint/suspicious/useAwait: no need
49
export const handleError = (async ({ error, event, status, message, ...context }) => {
510
const errorId = crypto.randomUUID()

app/src/hooks.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { Reroute } from "@sveltejs/kit"
2+
3+
/**
4+
* `hooks.{js|ts}` is a special SvelteKit file called "Universal Hooks"
5+
* @see https://kit.svelte.dev/docs/hooks#universal-hooks
6+
*/
7+
8+
export const reroute = (event => {
9+
const url = new URL(event.url)
10+
const pathname = url.pathname
11+
12+
if (pathname === "/") return "/explorer/transfers"
13+
}) satisfies Reroute

app/src/lib/wallet/evm/config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ config.subscribe(
127127
return state.chainId
128128
},
129129
chainId => {
130-
console.info("[config] chainId", chainId)
130+
//
131131
}
132132
)
133133

@@ -140,7 +140,6 @@ export function createSepoliaStore(
140140
connectedWallet: getAccount(config).connector?.id || "injected"
141141
}
142142
) {
143-
console.log("[sepoliaStore] previousState", previousState)
144143
const { subscribe, set, update } = writable(previousState)
145144
return {
146145
set,

app/src/routes/+page.ts

-6
This file was deleted.
File renamed without changes.

app/vite.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ export default defineConfig(config => {
2727
if (INSPECT === "true") plugins.push(Inspect())
2828
if (VISUALIZE === "true") plugins.push(visualizer({ filename: `stats/${Date.now()}_stats.html` }))
2929

30+
const dropLogStatements = config.mode === "build" || NODE_ENV === "production"
3031
return {
3132
plugins,
3233
esbuild: {
33-
drop: ["console", "debugger"]
34+
drop: dropLogStatements ? ["console", "debugger"] : []
3435
},
3536
optimizeDeps: {
3637
exclude: ["@tanstack/svelte-query-devtools"]

0 commit comments

Comments
 (0)