mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
33 lines
725 B
TypeScript
33 lines
725 B
TypeScript
import { Alert, Linking } from 'react-native';
|
|
|
|
import { isDesktop } from '../blue_modules/environment';
|
|
import loc from '../loc';
|
|
|
|
export const openPrivacyDesktopSettings = () => {
|
|
if (isDesktop) {
|
|
Linking.openURL('x-apple.systempreferences:com.apple.preference.security?Privacy_Camera');
|
|
} else {
|
|
Linking.openSettings();
|
|
}
|
|
};
|
|
|
|
export const presentCameraNotAuthorizedAlert = (error: string) => {
|
|
Alert.alert(
|
|
loc.errors.error,
|
|
error,
|
|
[
|
|
{
|
|
text: loc.send.open_settings,
|
|
onPress: openPrivacyDesktopSettings,
|
|
style: 'default',
|
|
},
|
|
{
|
|
text: loc._.ok,
|
|
onPress: () => {},
|
|
style: 'cancel',
|
|
},
|
|
],
|
|
{ cancelable: true },
|
|
);
|
|
};
|