debug: add logging to trace REACT_APP_ENABLED_FEATURES
This commit is contained in:
@@ -117,6 +117,13 @@ const InitialRouteHandler: React.FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isDemoMode = shouldSkipOnboarding();
|
const isDemoMode = shouldSkipOnboarding();
|
||||||
|
console.log('InitialRouteHandler DEBUG:', {
|
||||||
|
isDemoMode,
|
||||||
|
isOnboardingComplete,
|
||||||
|
subscription: subscription ? { plan: subscription.plan, active: subscription.active } : null,
|
||||||
|
loading,
|
||||||
|
data: !!data
|
||||||
|
});
|
||||||
const isActiveSubscriber = Boolean(subscription && subscription.active && subscription.plan !== 'none');
|
const isActiveSubscriber = Boolean(subscription && subscription.active && subscription.plan !== 'none');
|
||||||
const waitingForOnboardingInit = !isDemoMode && isActiveSubscriber && (loading || !data);
|
const waitingForOnboardingInit = !isDemoMode && isActiveSubscriber && (loading || !data);
|
||||||
if (waitingForOnboardingInit) {
|
if (waitingForOnboardingInit) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export function getEnabledFeatures(): Set<string> {
|
|||||||
// Check localStorage first
|
// Check localStorage first
|
||||||
const storageValue = localStorage.getItem(PRIMARY_STORAGE_KEY);
|
const storageValue = localStorage.getItem(PRIMARY_STORAGE_KEY);
|
||||||
if (storageValue) {
|
if (storageValue) {
|
||||||
|
console.log('demoMode: Found in localStorage:', storageValue);
|
||||||
const features = storageValue.toLowerCase().split(',').map(f => f.trim());
|
const features = storageValue.toLowerCase().split(',').map(f => f.trim());
|
||||||
if (features.includes('all')) {
|
if (features.includes('all')) {
|
||||||
return new Set(['all']);
|
return new Set(['all']);
|
||||||
@@ -25,6 +26,7 @@ export function getEnabledFeatures(): Set<string> {
|
|||||||
|
|
||||||
// Check environment variable
|
// Check environment variable
|
||||||
const envValue = process.env[PRIMARY_ENV_KEY];
|
const envValue = process.env[PRIMARY_ENV_KEY];
|
||||||
|
console.log('demoMode: ENV value for', PRIMARY_ENV_KEY, ':', envValue);
|
||||||
if (envValue) {
|
if (envValue) {
|
||||||
const features = envValue.toLowerCase().split(',').map(f => f.trim());
|
const features = envValue.toLowerCase().split(',').map(f => f.trim());
|
||||||
if (features.includes('all')) {
|
if (features.includes('all')) {
|
||||||
@@ -34,6 +36,7 @@ export function getEnabledFeatures(): Set<string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Default: all features enabled
|
// Default: all features enabled
|
||||||
|
console.log('demoMode: No env var, returning default "all"');
|
||||||
return new Set(['all']);
|
return new Set(['all']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user