mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 09:53:48 +00:00
fix: prevent infinite render in settings forms
This commit is contained in:
committed by
Carlos Valente
parent
b6a01a52e2
commit
31fd8e5200
@@ -32,7 +32,6 @@ export default function GeneralSettings() {
|
||||
} = useForm<Settings>({
|
||||
mode: 'onChange',
|
||||
defaultValues: data,
|
||||
values: data,
|
||||
resetOptions: {
|
||||
keepDirtyValues: true,
|
||||
},
|
||||
|
||||
@@ -31,7 +31,6 @@ export default function ViewSettings() {
|
||||
formState: { isSubmitting, isDirty, errors },
|
||||
} = useForm<ViewSettingsType>({
|
||||
defaultValues: data,
|
||||
values: data,
|
||||
resetOptions: {
|
||||
keepDirtyValues: true,
|
||||
},
|
||||
|
||||
+4
-2
@@ -1,4 +1,4 @@
|
||||
import { lazy, useEffect, useRef, useState } from 'react';
|
||||
import { lazy, Suspense, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { getCSSContents, postCSSContents, restoreCSSContents } from '../../../../../common/api/assets';
|
||||
import Button from '../../../../../common/components/buttons/Button';
|
||||
@@ -81,7 +81,9 @@ export default function CodeEditorModal({ isOpen, onClose }: CodeEditorModalProp
|
||||
showCloseButton
|
||||
showBackdrop
|
||||
bodyElements={
|
||||
<CodeEditor ref={cssRef} initialValue={css} language='css' isDirty={isDirty} setIsDirty={setIsDirty} />
|
||||
<Suspense fallback={null}>
|
||||
<CodeEditor ref={cssRef} initialValue={css} language='css' isDirty={isDirty} setIsDirty={setIsDirty} />
|
||||
</Suspense>
|
||||
}
|
||||
footerElements={
|
||||
<div className={style.column}>
|
||||
|
||||
Reference in New Issue
Block a user