Skip to content

Commit

Permalink
feat(app): switch landing redirect strategy (#2942)
Browse files Browse the repository at this point in the history
  • Loading branch information
cor authored Sep 11, 2024
2 parents 0848f4c + 320d50c commit 1981197
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
5 changes: 5 additions & 0 deletions app/src/hooks.client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import type { HandleClientError } from "@sveltejs/kit"

/**
* `hooks.client.{js|ts}` is a special SvelteKit file called "Shared Hooks"
* @see https://kit.svelte.dev/docs/hooks#shared-hooks
*/

// biome-ignore lint/suspicious/useAwait: no need
export const handleError = (async ({ error, event, status, message, ...context }) => {
const errorId = crypto.randomUUID()
Expand Down
13 changes: 13 additions & 0 deletions app/src/hooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Reroute } from "@sveltejs/kit"

/**
* `hooks.{js|ts}` is a special SvelteKit file called "Universal Hooks"
* @see https://kit.svelte.dev/docs/hooks#universal-hooks
*/

export const reroute = (event => {
const url = new URL(event.url)
const pathname = url.pathname

if (pathname === "/") return "/explorer/transfers"
}) satisfies Reroute
3 changes: 1 addition & 2 deletions app/src/lib/wallet/evm/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ config.subscribe(
return state.chainId
},
chainId => {
console.info("[config] chainId", chainId)
//
}
)

Expand All @@ -140,7 +140,6 @@ export function createSepoliaStore(
connectedWallet: getAccount(config).connector?.id || "injected"
}
) {
console.log("[sepoliaStore] previousState", previousState)
const { subscribe, set, update } = writable(previousState)
return {
set,
Expand Down
6 changes: 0 additions & 6 deletions app/src/routes/+page.ts

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export default defineConfig(config => {
if (INSPECT === "true") plugins.push(Inspect())
if (VISUALIZE === "true") plugins.push(visualizer({ filename: `stats/${Date.now()}_stats.html` }))

const dropLogStatements = config.mode === "build" || NODE_ENV === "production"
return {
plugins,
esbuild: {
drop: ["console", "debugger"]
drop: dropLogStatements ? ["console", "debugger"] : []
},
optimizeDeps: {
exclude: ["@tanstack/svelte-query-devtools"]
Expand Down

0 comments on commit 1981197

Please sign in to comment.