mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 21:54:09 +00:00
fix: small style tweaks and bug fixes
fix: remove interactive styles from display elements fix: automation form reset on submit fix: prevent empty image src
This commit is contained in:
committed by
Carlos Valente
parent
902edf4a85
commit
836fa52757
@@ -42,7 +42,6 @@ interface AutomationFormProps {
|
||||
}
|
||||
|
||||
export default function AutomationForm({ automation, onClose }: AutomationFormProps) {
|
||||
'no memo'; // RHF and react-compiler dont seem to get along
|
||||
const isEdit = isAutomation(automation);
|
||||
const { data } = useCustomFields();
|
||||
const { refetch } = useAutomationSettings();
|
||||
|
||||
+2
-4
@@ -25,8 +25,6 @@ export default function AutomationSettingsForm({
|
||||
enabledOscIn,
|
||||
oscPortIn,
|
||||
}: AutomationSettingsProps) {
|
||||
'no memo'; // RHF and react-compiler dont seem to get along
|
||||
|
||||
const {
|
||||
handleSubmit,
|
||||
reset,
|
||||
@@ -38,15 +36,15 @@ export default function AutomationSettingsForm({
|
||||
} = useForm<AutomationSettingsProps>({
|
||||
mode: 'onChange',
|
||||
defaultValues: { enabledAutomations, enabledOscIn, oscPortIn },
|
||||
values: { enabledAutomations, enabledOscIn, oscPortIn },
|
||||
resetOptions: {
|
||||
keepDirtyValues: true,
|
||||
keepDirtyValues: false,
|
||||
},
|
||||
});
|
||||
|
||||
const onSubmit = async (formData: AutomationSettingsProps) => {
|
||||
try {
|
||||
await editAutomationSettings(formData);
|
||||
reset(formData);
|
||||
} catch (error) {
|
||||
const message = maybeAxiosError(error);
|
||||
setError('root', { message });
|
||||
|
||||
@@ -248,7 +248,9 @@ export default function ProjectData() {
|
||||
{...register(`custom.${idx}.url`)}
|
||||
/>
|
||||
<div className={style.imageContainer}>
|
||||
<img src={watch(`custom.${idx}.url`)} alt='' loading='lazy' className='info__image' />
|
||||
{watch(`custom.${idx}.url`) && (
|
||||
<img src={watch(`custom.${idx}.url`)} alt='' loading='lazy' className='info__image' />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user