Skip to content

Commit 1847fa6

Browse files
committed
PR changes and persist state check
1 parent 5d2eef0 commit 1847fa6

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

frontend/app/routes/api.grant.$type.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { redirect, type LoaderFunctionArgs } from 'react-router'
1+
import { redirect } from 'react-router'
22
import { commitSession, getSession } from '~/utils/session.server'
33
import { isGrantValidAndAccepted } from '~/utils/open-payments.server'
44

5-
export async function loader({ params, request, context }: LoaderFunctionArgs) {
5+
import type { Route } from './+types/api.grant.$type'
6+
7+
export async function loader({ params, request, context }: Route.LoaderArgs) {
68
const { env } = context.cloudflare
79

810
const elementType = params.type

frontend/vite.config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,24 @@ export default defineConfig(({ mode, isSsrBuild }) => {
1616
__dirname,
1717
'./app/components/redesign/Typography.tsx'
1818
),
19-
'@/assets': path.resolve(__dirname, './app/assets/svg.tsx')
20-
}
21-
22-
if (isProduction && !isSsrBuild) {
23-
alias['crypto'] = 'crypto-browserify'
19+
'@/assets': path.resolve(__dirname, './app/assets/svg.tsx'),
20+
...(isProduction && !isSsrBuild && { crypto: 'crypto-browserify' })
2421
}
2522

2623
return {
2724
define: {
2825
BUILD_CDN_URL: JSON.stringify(process.env.BUILD_CDN_URL),
2926
BUILD_API_URL: JSON.stringify(process.env.BUILD_API_URL)
3027
},
31-
plugins: [cloudflare(), reactRouter(), tsconfigPaths()],
28+
plugins: [
29+
cloudflare({
30+
persistState: {
31+
path: '../.wrangler/v3'
32+
}
33+
}),
34+
reactRouter(),
35+
tsconfigPaths()
36+
],
3237
resolve: {
3338
alias
3439
},

0 commit comments

Comments
 (0)