- nuke visible from the face of the earth with fire.
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -33,7 +33,7 @@ export function NoteUpsertModalContainer({
|
||||
const [insertNote] = useMutation(INSERT_NEW_NOTE);
|
||||
const [updateNote] = useMutation(UPDATE_NOTE);
|
||||
|
||||
const { visible, context, actions } = noteUpsertModal;
|
||||
const { open, context, actions } = noteUpsertModal;
|
||||
const { jobId, existingNote, text } = context;
|
||||
const { refetch } = actions;
|
||||
|
||||
@@ -41,16 +41,16 @@ export function NoteUpsertModalContainer({
|
||||
|
||||
useEffect(() => {
|
||||
//Required to prevent infinite looping.
|
||||
if (existingNote && visible) {
|
||||
if (existingNote && open) {
|
||||
form.setFieldsValue(existingNote);
|
||||
} else if (!existingNote && visible) {
|
||||
} else if (!existingNote && open) {
|
||||
form.resetFields();
|
||||
|
||||
if (text) {
|
||||
form.setFieldValue("text", text);
|
||||
}
|
||||
}
|
||||
}, [existingNote, form, visible, text]);
|
||||
}, [existingNote, form, open, text]);
|
||||
|
||||
const handleFinish = async (formValues) => {
|
||||
const { relatedros, ...values } = formValues;
|
||||
@@ -122,7 +122,7 @@ export function NoteUpsertModalContainer({
|
||||
return (
|
||||
<Modal
|
||||
title={existingNote ? t("notes.actions.edit") : t("notes.actions.new")}
|
||||
open={visible}
|
||||
open={open}
|
||||
okText={t("general.actions.save")}
|
||||
onOk={() => {
|
||||
form.submit();
|
||||
|
||||
Reference in New Issue
Block a user