← All changes
|
src/Agent/workflows/block-selector/tools/get-block-content.js
+3
-2
3.0.5
→
trunk
View file →
| @@ -1,9 +1,10 @@ | ||
| 1 | -import { useWorkflowStore } from '@agent/state/workflows'; | |
| 1 | +import { useQuickEditStore } from '@quick-edit/state/store'; | |
| 2 | 2 | import apiFetch from '@wordpress/api-fetch'; |
| 3 | 3 | |
| 4 | 4 | export default async () => { |
| 5 | - const { block } = useWorkflowStore.getState(); | |
| 5 | + const block = useQuickEditStore.getState().agentBlock; | |
| 6 | + if (!block?.id) return { previousContent: '' }; | |
| 6 | 7 | const { postId } = window.extAgentData.context; |
| 7 | 8 | const response = await apiFetch({ |
| 8 | 9 | path: `/extendify/v1/agent/get-block-code?postId=${postId}&blockId=${block.id}`, |
| 9 | 10 | }); |