File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
packages/frontend/src/components/EditorLayout Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,24 @@ export default function EditorLayout() {
4646 const isMobile = useIsMobile ( )
4747 const [ updateFlow ] = useMutation ( UPDATE_FLOW )
4848 const [ updateFlowStatus ] = useMutation ( UPDATE_FLOW_STATUS , {
49- refetchQueries : [ GET_FLOW ] ,
49+ update ( cache , { data } ) {
50+ const flow = cache . readQuery < { getFlow : IFlow } > ( {
51+ query : GET_FLOW ,
52+ variables : { id : flowId } ,
53+ } )
54+ if ( flow ?. getFlow ) {
55+ cache . writeQuery ( {
56+ query : GET_FLOW ,
57+ variables : { id : flowId } ,
58+ data : {
59+ getFlow : {
60+ ...flow . getFlow ,
61+ active : data . updateFlowStatus . active ,
62+ } ,
63+ } ,
64+ } )
65+ }
66+ } ,
5067 } )
5168 const [ shouldWarnOnLeave , setShouldWarnOnLeave ] = useState ( false )
5269 const {
You can’t perform that action at this time.
0 commit comments