Skip to content

Commit a4b2233

Browse files
committed
Fix clear button issue in json editor
Memoization of the clear function caused some problems. Removing it should not cause performance issues.
1 parent c8958ac commit a4b2233

File tree

2 files changed

+4
-4
lines changed
  • apps/webapp/app
    • components/code
    • routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam

2 files changed

+4
-4
lines changed

apps/webapp/app/components/code/JSONEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ export function JSONEditor(opts: JSONEditorProps) {
125125
}
126126
}, [defaultValue, view]);
127127

128-
const clear = useCallback(() => {
128+
const clear = () => {
129129
if (view === undefined) return;
130130
view.dispatch({
131131
changes: { from: 0, to: view.state.doc.length, insert: undefined },
132132
});
133133
onChange?.("");
134-
}, [view]);
134+
};
135135

136136
const copy = useCallback(() => {
137137
if (view === undefined) return;

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,10 @@ function StandardTaskForm({
481481
onChange={(v) => {
482482
if (!tab || tab === "payload") {
483483
currentPayloadJson.current = v;
484-
setDefaultPayloadJson(v);
484+
setPayload(v);
485485
} else {
486486
currentMetadataJson.current = v;
487-
setDefaultMetadataJson(v);
487+
setMetadata(v);
488488
}
489489
}}
490490
height="100%"

0 commit comments

Comments
 (0)