Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 925a10c

Browse files
committed
QRCode: fix Android undefined is not a function (evaluating 'Camera.checkDeviceAuthorizationStatus()')
1 parent 1db4fdf commit 925a10c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/layouts/Login.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ class Login extends Component {
2525
const {ui, router, actions} = this.props
2626
if (ui.checkTokenPending) { return }
2727
if (Platform.OS !== 'web') {
28-
Camera.checkDeviceAuthorizationStatus()
29-
.then((isAuth) => {
30-
if (isAuth) {
31-
router.toQRCode()
32-
} else {
33-
actions.toast('请在设置中开启Noder对相机的访问')
34-
}
35-
})
36-
.catch((err) => {
37-
actions.toast('获取相机访问权错误')
38-
})
28+
Platform.OS === 'android' ? router.toQRCode() : Camera.checkDeviceAuthorizationStatus()
29+
.then((isAuth) => {
30+
if (isAuth) {
31+
router.toQRCode()
32+
} else {
33+
actions.toast('请在设置中开启Noder对相机的访问')
34+
}
35+
})
36+
.catch(() => {
37+
actions.toast('获取相机访问权错误')
38+
})
3939
}
4040
}
4141

0 commit comments

Comments
 (0)