Skip to content

Commit

Permalink
update new wordpress source plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Feb 9, 2021
1 parent b6b4cbb commit 2e4cc3a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const persistPreviouslyCachedImages: Step = async (): Promise<void> => {

// and touch them so they aren't garbage collected.
// we will remove them as needed when receiving DELETE events from WP
mediaItemNodes.forEach(({ id }) => helpers.actions.touchNode({ nodeId: id }))
mediaItemNodes.forEach(node => helpers.actions.touchNode(node))

const imageNodeMetaByUrl = await getPersistentCache({
key: `image-node-meta-by-url`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const touchValidNodes = async () => {
const validNodeIds = await getPersistentCache({ key: CREATED_NODE_IDS })

if (validNodeIds?.length) {
validNodeIds.forEach(nodeId => actions.touchNode({ nodeId }))
validNodeIds.forEach(nodeId => actions.touchNode(actions.getNode(nodeId)))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const wpActionDELETE = async ({
}

if (node) {
await actions.touchNode({ nodeId })
await actions.touchNode(node)
await actions.deleteNode({ node })

reporter.log(``)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ const wpActionUPDATE = async ({ helpers, wpAction }) => {
await setPersistentCache({ key: CREATED_NODE_IDS, value: validNodeIds })

if (existingNode) {
await actions.touchNode({ nodeId })
await actions.touchNode(existingNode)
await actions.deleteNode({ node: existingNode })
reportUpdate({ setAction: `DELETE` })
}
Expand Down

0 comments on commit 2e4cc3a

Please sign in to comment.