mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
308e9e1545
Removes the need to manual code adjustments on platforms that aren't compatible with react-native-tor
21 lines
657 B
JavaScript
21 lines
657 B
JavaScript
import { Platform } from 'react-native';
|
|
import { getSystemName, isTablet, getDeviceType } from 'react-native-device-info';
|
|
|
|
const isMacCatalina = getSystemName() === 'Mac OS X';
|
|
const isDesktop = getDeviceType() === 'Desktop';
|
|
const isTorCapable = () => {
|
|
let capable = true;
|
|
if (Platform.OS === 'android' && Platform.Version < 26) {
|
|
capable = false;
|
|
} else if (isDesktop) {
|
|
capable = false;
|
|
}
|
|
return capable;
|
|
};
|
|
|
|
module.exports.isMacCatalina = isMacCatalina;
|
|
module.exports.isDesktop = isDesktop;
|
|
module.exports.isHandset = getDeviceType() === 'Handset';
|
|
module.exports.isTablet = isTablet;
|
|
module.exports.isTorCapable = isTorCapable();
|