mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
Update permission check logic
This commit is contained in:
@@ -70,21 +70,19 @@ class OnRamperPageBodyState extends State<OnRamperPageBody> {
|
||||
crossPlatform: InAppWebViewOptions(transparentBackground: true),
|
||||
),
|
||||
initialUrlRequest: URLRequest(
|
||||
url: Uri.tryParse(
|
||||
widget.uri.toString(),
|
||||
),
|
||||
url: widget.uri,
|
||||
),
|
||||
androidOnPermissionRequest: (_, __, resources) async {
|
||||
bool permissionNotGranted = await Permission.camera.status != PermissionStatus.granted;
|
||||
if (permissionNotGranted) {
|
||||
permissionNotGranted = await Permission.camera.request().isGranted;
|
||||
bool permissionGranted = await Permission.camera.status == PermissionStatus.granted;
|
||||
if (!permissionGranted) {
|
||||
permissionGranted = await Permission.camera.request().isGranted;
|
||||
}
|
||||
|
||||
return PermissionRequestResponse(
|
||||
resources: resources,
|
||||
action: permissionNotGranted
|
||||
? PermissionRequestResponseAction.DENY
|
||||
: PermissionRequestResponseAction.GRANT,
|
||||
action: permissionGranted
|
||||
? PermissionRequestResponseAction.GRANT
|
||||
: PermissionRequestResponseAction.DENY,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user