This repository was archived by the owner on Dec 12, 2024. It is now read-only.
generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 6
This repository was archived by the owner on Dec 12, 2024. It is now read-only.
Fix isPhysicalDevice check in web environment #296
Copy link
Copy link
Closed
Labels
Description
- when running didpay on web (by selecting "Chrome - web" as your device in VSCode), an unsupported operation error is thrown when running the
isPhysicalDevice()check - originally, this check was used to see if the user was on a real, physical device so the app knows if it is possible to use the camera (i.e. to scan qr codes)
- since didpay on web will not support qr code scanning, add a check to the
isPhysicalDevice()method inDeviceInfoServiceto prevent the below error
DartError: Unsupported operation: Platform._operatingSystem
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3 throw_
dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 244:5 _operatingSystem
dart-sdk/lib/io/platform_impl.dart 56:40 get operatingSystem
dart-sdk/lib/io/platform.dart 83:44 get operatingSystem
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 1293:8 get
dart-sdk/lib/io/platform.dart 161:46 get isIOS
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 1293:8 get
packages/didpay/features/device/device_info_service.dart 11:53 isPhysicalDevice
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5 _async
packages/didpay/features/device/device_info_service.dart 11:32 isPhysicalDevice
packages/didpay/features/dap/dap_qr_tile.dart 28:30 <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5 _async
packages/didpay/features/dap/dap_qr_tile.dart 27:11 <fn>
dart-sdk/lib/async/future.dart 422:39 <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:11 internalCallback