Skip to content

Commit

Permalink
Resolve discussions
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Mar 9, 2020
1 parent ce75351 commit 694d8d7
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions packages/gatsby/src/redux/actions/add-page-dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export const createPageDependency = ({
path,
nodeId,
connection,
}: Parameters<typeof internalCreatePageDependency>[0]): void => {
const {
componentDataDependencies: { connections, nodes },
} = store.getState()
}: {
path: string
nodeId: string
connection: string
}): void => {
const { componentDataDependencies } = store.getState()

// Check that the dependencies aren't already recorded so we
// can avoid creating lots of very noisy actions.
Expand All @@ -18,16 +20,20 @@ export const createPageDependency = ({
if (!nodeId) {
nodeDependencyExists = true
}
if (nodeId && nodes.has(nodeId) && nodes.get(nodeId).has(path)) {
if (
nodeId &&
componentDataDependencies.nodes.has(nodeId) &&
componentDataDependencies.nodes.get(nodeId).has(path)
) {
nodeDependencyExists = true
}
if (!connection) {
connectionDependencyExists = true
}
if (
connection &&
connections.has(connection) &&
connections.get(connection).has(path)
componentDataDependencies.connections.has(connection) &&
componentDataDependencies.connections.get(connection).has(path)
) {
connectionDependencyExists = true
}
Expand Down

0 comments on commit 694d8d7

Please sign in to comment.