TryGhost/algolia

Check for ALGOLIA_ACTIVE is incorrect

Closed this issue · 0 comments

I noticed that the check here: https://github.com/TryGhost/algolia/blob/master/packages/algolia-netlify/functions/post-published.js#L5

Is incorrect, it's casting the environment variable to a boolean, and then comparing that with a string, so this will never evaluate to true!

It might be better to change it to:

    if (process.env.ALGOLIA_ACTIVE !== 'TRUE') {