Skip to content

Commit

Permalink
fix: form context
Browse files Browse the repository at this point in the history
  • Loading branch information
yinkaihui committed Mar 15, 2024
1 parent b9c3c64 commit 8242bc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/deploy-site-preview.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: deploy-site-preview
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_run:
workflows: [npm-publish]
types:
- completed
workflows: ['pr_check']
types: completed

push:
tags:
- '*'
- '!(*(beta|alpha)*)'

workflow_dispatch:

Expand Down
2 changes: 1 addition & 1 deletion components/Form/hooks/useContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const useFormContext = (): { form: FormInstance; disabled: boolean; isSubmitting
const [isSubmitting, setIsSubmitting] = useState(false);

const setSubmitting = useCallback(() => {
const { submitStatus } = formInstance?.getInnerMethods(true).innerGetStoreStatus();
const { submitStatus } = formInstance?.getInnerMethods(true)?.innerGetStoreStatus?.() || {};
const newIsSubmitting = submitStatus === SubmitStatus.submitting;
if (isSubmitting !== newIsSubmitting) {
setIsSubmitting(newIsSubmitting);
Expand Down

0 comments on commit 8242bc3

Please sign in to comment.