pi-kiosk-shared 1.0.20 → 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,13 +101,24 @@ export const getCurrentEnvironment = () => {
94
101
  }
95
102
  }
96
103
  catch (e) {
97
- // Fallback: check if we're on Railway domain
98
- if (window.location &&
99
- (window.location.hostname.includes('railway.app') ||
100
- window.location.hostname.includes('up.railway.app'))) {
101
- return 'production';
104
+ // Ignore errors
105
+ }
106
+ }
107
+ // Additional fallback: check for production URLs in environment variables
108
+ if (typeof window !== 'undefined') {
109
+ try {
110
+ // @ts-ignore - Vite environment
111
+ const meta = globalThis.import?.meta;
112
+ if (meta && meta.env) {
113
+ const apiUrl = meta.env.VITE_API_URL || meta.env.REACT_APP_API_URL;
114
+ if (apiUrl && apiUrl.includes('railway.app')) {
115
+ return 'production';
116
+ }
102
117
  }
103
118
  }
119
+ catch (e) {
120
+ // Ignore errors
121
+ }
104
122
  }
105
123
  return 'development';
106
124
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-kiosk-shared",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "private": false,
5
5
  "description": "Shared components and utilities for Pi Kiosk system",
6
6
  "keywords": [