Skip to content

Commit

Permalink
DataManager: minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunanoordin committed Sep 4, 2023
1 parent 987f1e0 commit 429cc1a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/pages/lab-pages-editor/DataManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,18 @@ function DataManager({
const wf = apiData.workflow;
if (!wf) return;

setApiData({
workflow: wf,
setApiData((prevState) => ({
...prevState,
status: 'updating'
});
}));

const newWorkflow = await wf.update(data).save();

await wf.update(data).save();
console.log('+++ are they the same? ', newWorkflow === wf);

// Note to self: hang on, will setting setApiData() cause the useMemo to update perpetually?
setApiData({
workflow: apiData.workflow,
workflow: newWorkflow,
status: 'ready'
});

Expand All @@ -93,7 +95,7 @@ function DataManager({
// has changed when the change is local to the resource itself?
// Does the workflow object have an internal version tracker?
// @shaunanoordin 20230902
setRandomFlagToPromptMemoUpdate(Math.floor(Math.random() * 10000));
// setRandomFlagToPromptMemoUpdate(Math.floor(Math.random() * 10000));
}

return {
Expand Down

0 comments on commit 429cc1a

Please sign in to comment.