pi-kiosk-shared 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -84,6 +84,13 @@ export const getCurrentEnvironment = () => {
|
|
|
84
84
|
if (typeof process !== 'undefined' && process.env) {
|
|
85
85
|
return process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
|
86
86
|
}
|
|
87
|
+
// Check if we're on Railway domain (most reliable for production detection)
|
|
88
|
+
if (typeof window !== 'undefined' && window.location) {
|
|
89
|
+
if (window.location.hostname.includes('railway.app') ||
|
|
90
|
+
window.location.hostname.includes('up.railway.app')) {
|
|
91
|
+
return 'production';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
87
94
|
// Check for import.meta.env (Vite environment)
|
|
88
95
|
if (typeof window !== 'undefined') {
|
|
89
96
|
try {
|
|
@@ -94,12 +101,7 @@ export const getCurrentEnvironment = () => {
|
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
103
|
catch (e) {
|
|
97
|
-
//
|
|
98
|
-
if (window.location &&
|
|
99
|
-
(window.location.hostname.includes('railway.app') ||
|
|
100
|
-
window.location.hostname.includes('up.railway.app'))) {
|
|
101
|
-
return 'production';
|
|
102
|
-
}
|
|
104
|
+
// Ignore errors
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
// Additional fallback: check for production URLs in environment variables
|