Skip to content

Commit

Permalink
prevents signal sent from client to server
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsfletch committed Oct 3, 2024
1 parent ee85323 commit cf61776
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 54 deletions.
51 changes: 0 additions & 51 deletions packages/next/src/routes/rest/buildFormState.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/src/routes/rest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { registerFirstUser } from './auth/registerFirstUser.js'
import { resetPassword } from './auth/resetPassword.js'
import { unlock } from './auth/unlock.js'
import { verifyEmail } from './auth/verifyEmail.js'
import { buildFormState } from './buildFormState.js'
import { endpointsAreDisabled } from './checkEndpoints.js'
import { count } from './collections/count.js'
import { create } from './collections/create.js'
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/src/providers/ServerFunctions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ export const ServerFunctionsProvider: React.FC<{

const getFormState = useCallback<GetFormState>(
async (args) => {
const { signal, ...rest } = args
try {
const result = (await serverFunction({
name: 'form-state',
args,
args: rest,
})) as ReturnType<typeof buildFormState> // TODO: infer this type when `strictNullChecks` is enabled

if (args.signal?.aborted) {
if (signal?.aborted) {
return { state: args.formState }
}

Expand Down

0 comments on commit cf61776

Please sign in to comment.