fix: handle invalid Algolia keys gracefully in dev (#37088)

Invalid keys throw an error in production, but just cause invalid
PropTypes and build warnings in development.
This commit is contained in:
Oliver Eyton-Williams
2019-10-08 10:19:43 +02:00
committed by mrugesh
parent 4889e0fdc6
commit e72855dad3
4 changed files with 28 additions and 7 deletions

View File

@ -30,6 +30,12 @@ const locations = {
module.exports = Object.assign(locations, {
locale,
stripePublicKey,
algoliaAppId,
algoliaAPIKey
algoliaAppId:
!algoliaAppId || algoliaAppId === 'Algolia app id from dashboard'
? null
: algoliaAppId,
algoliaAPIKey:
!algoliaAPIKey || algoliaAPIKey === 'Algolia api key from dashboard'
? null
: algoliaAPIKey
});