mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 04:27:56 +00:00
fix: Resolve mobile app crash with import.meta and babel config
- Add guard for import.meta in endpoints.ts for React Native compatibility - Add jsEngine: jsc to app.json to match gradle.properties - Add @babel/plugin-transform-class-static-block for @pezkuwi/types-codec
This commit is contained in:
@@ -122,7 +122,15 @@ export function getAllNetworks(): NetworkConfig[] {
|
||||
* @returns {NetworkConfig} The active network configuration.
|
||||
*/
|
||||
export const getCurrentNetworkConfig = (): NetworkConfig => {
|
||||
const networkName = (import.meta.env.VITE_NETWORK || 'local').toUpperCase();
|
||||
let networkName = 'LOCAL';
|
||||
|
||||
// Support both Vite (web) and React Native environments
|
||||
if (typeof process !== 'undefined' && process.env?.EXPO_PUBLIC_NETWORK) {
|
||||
networkName = process.env.EXPO_PUBLIC_NETWORK.toUpperCase();
|
||||
} else if (typeof import.meta !== 'undefined' && (import.meta as any).env?.VITE_NETWORK) {
|
||||
networkName = ((import.meta as any).env.VITE_NETWORK || 'local').toUpperCase();
|
||||
}
|
||||
|
||||
const validNetworkKeys = Object.keys(NETWORK_ENDPOINTS);
|
||||
|
||||
if (validNetworkKeys.includes(networkName)) {
|
||||
|
||||
Reference in New Issue
Block a user