mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-25 16:28:02 +00:00
fix(mobile): critical security and error handling improvements
🔐 SECURITY FIXES: - Fixed CRITICAL seed storage vulnerability * Changed from AsyncStorage to SecureStore for wallet seeds * Seeds now encrypted in hardware-backed secure storage * Affects: PolkadotContext.tsx (lines 166, 189) 🛡️ ERROR HANDLING: - Added global ErrorBoundary component * Catches unhandled React errors * Shows user-friendly error UI * Integrated into App.tsx provider hierarchy * Files: ErrorBoundary.tsx (new), App.tsx, components/index.ts 🧹 PRODUCTION READINESS: - Protected all 47 console statements with __DEV__ checks * console.log: 12 statements * console.error: 32 statements * console.warn: 1 statement * Files affected: 16 files across contexts, screens, i18n * Production builds will strip these out 📦 PROVIDER HIERARCHY: - Added BiometricAuthProvider to App.tsx - Updated provider order: ErrorBoundary → Polkadot → Language → BiometricAuth → Navigator Files modified: 18 New files: 1 (ErrorBoundary.tsx) This commit resolves 3 P0 critical issues from production readiness audit.
This commit is contained in:
@@ -149,7 +149,7 @@ const WalletScreen: React.FC = () => {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('PEZ asset not found or not accessible');
|
||||
if (__DEV__) console.log('PEZ asset not found or not accessible');
|
||||
}
|
||||
|
||||
// Fetch USDT balance (wUSDT - asset ID 2)
|
||||
@@ -163,7 +163,7 @@ const WalletScreen: React.FC = () => {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('USDT asset not found or not accessible');
|
||||
if (__DEV__) console.log('USDT asset not found or not accessible');
|
||||
}
|
||||
|
||||
setBalances({
|
||||
@@ -172,7 +172,7 @@ const WalletScreen: React.FC = () => {
|
||||
USDT: usdtBalance,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch balances:', err);
|
||||
if (__DEV__) console.error('Failed to fetch balances:', err);
|
||||
Alert.alert('Error', 'Failed to fetch token balances');
|
||||
} finally {
|
||||
setIsLoadingBalances(false);
|
||||
@@ -198,7 +198,7 @@ const WalletScreen: React.FC = () => {
|
||||
await connectWallet();
|
||||
Alert.alert('Connected', 'Wallet connected successfully!');
|
||||
} catch (err) {
|
||||
console.error('Failed to connect wallet:', err);
|
||||
if (__DEV__) console.error('Failed to connect wallet:', err);
|
||||
Alert.alert('Error', 'Failed to connect wallet');
|
||||
}
|
||||
};
|
||||
@@ -220,7 +220,7 @@ const WalletScreen: React.FC = () => {
|
||||
[{ text: 'OK', onPress: () => connectWallet() }]
|
||||
);
|
||||
} catch (err) {
|
||||
console.error('Failed to create wallet:', err);
|
||||
if (__DEV__) console.error('Failed to create wallet:', err);
|
||||
Alert.alert('Error', 'Failed to create wallet');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user