Skip to content

Commit

Permalink
build(afterchange): fail silently of no token (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsonsj authored Jul 2, 2023
1 parent a309dd7 commit 5149238
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/hooks/collections/afterChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ const performAfterChange = async ({
global = false,
pluginOptions,
}: IPerformChange) => {
/**
* Abort if token not set and not in test mode
*/
if (!pluginOptions.token && process.env.NODE_ENV !== 'test') {
return doc
}

const localizedFields: Field[] = getLocalizedFields({fields: collection.fields})

/**
Expand Down

0 comments on commit 5149238

Please sign in to comment.