Skip to content

Commit 385c388

Browse files
committed
chore: prevent pipe name flicker on publish
1 parent 6762cc2 commit 385c388

File tree

1 file changed

+18
-1
lines changed
  • packages/frontend/src/components/EditorLayout

1 file changed

+18
-1
lines changed

packages/frontend/src/components/EditorLayout/index.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)