| @@ -15,8 +15,10 @@ | ||
| 15 | 15 | const state = (set, get) => ({ |
| 16 | 16 | workflow: null, |
| 17 | 17 | // Data for the tool component that shows up at the end of a workflow |
| 18 | 18 | whenFinishedToolProps: null, |
| 19 | + // A staged tool restored from storage; its confirm never renders. | |
| 20 | + reloadedToolProps: null, | |
| 19 | 21 | getWorkflow: () => { |
| 20 | 22 | const curr = get().workflow; |
| 21 | 23 | // Workflows may define a "parent" workflow via templateId |
| 22 | 24 | const currId = curr?.templateId || curr?.id; |
| @@ -126,8 +128,9 @@ | ||
| 126 | 128 | whenFinishedToolProps: null, |
| 127 | 129 | workflowData: null, |
| 128 | 130 | }; |
| 129 | 131 | } |
| 130 | - return merged; | |
| 132 | + return { ...merged, reloadedToolProps: merged.whenFinishedToolProps }; | |
| 131 | 133 | }, |
| 134 | + partialize: ({ reloadedToolProps, ...persisted }) => persisted, | |
| 132 | 135 | }), |
| 133 | 136 | ); |