WIP(shops): safer debug mode

This commit is contained in:
Sabe Jones
2024-05-21 09:11:18 -05:00
parent 36b589e92d
commit c0d6338eba
16 changed files with 118 additions and 90 deletions

View File

@@ -353,10 +353,13 @@ const mockAnalyticsService = {
// Return the production or mock service based on the current environment
function getServiceByEnvironment () {
return {
track,
trackPurchase,
};
if (nconf.get('IS_PROD') || (nconf.get('DEBUG_ENABLED') && !nconf.get('BASE_URL').includes('localhost'))) {
return {
track,
trackPurchase,
};
}
return mockAnalyticsService;
}
export {