Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/v446'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Healy committed Apr 23, 2019
2 parents b8aa8bb + da6ce5e commit e5751af
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [v446](https://github.com/uport-project/uport-mobile/tree/v446) (2019-04-23)
[Full Changelog](https://github.com/uport-project/uport-mobile/compare/v445...v446)

**Merged pull requests:**

- Change scanner permission logic [\#130](https://github.com/uport-project/uport-mobile/pull/130) ([jasonhealy](https://github.com/jasonhealy))

## [v445](https://github.com/uport-project/uport-mobile/tree/v445) (2019-04-23)
[Full Changelog](https://github.com/uport-project/uport-mobile/compare/v444...v445)

Expand Down
4 changes: 2 additions & 2 deletions android/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#This is a generated file so things tend to get overwritten.
#Use `gradlew bumpVersion` to increment the version by 1
#or `gradlew bumpVersion -P_BUILD_NUMBER=<your specific version>` to set it manually
#Tue Apr 23 18:04:44 IST 2019
BUILD_NUMBER=445
#Tue Apr 23 22:41:28 IST 2019
BUILD_NUMBER=446
4 changes: 2 additions & 2 deletions ios/uPortMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
COPY_HEADERS_RUN_UNIFDEF = NO;
CURRENT_PROJECT_VERSION = 445;
CURRENT_PROJECT_VERSION = 446;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 82SAVLYZ3K;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2455,7 +2455,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
COPY_HEADERS_RUN_UNIFDEF = NO;
CURRENT_PROJECT_VERSION = 445;
CURRENT_PROJECT_VERSION = 446;
DEVELOPMENT_TEAM = 82SAVLYZ3K;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
2 changes: 1 addition & 1 deletion ios/uPortMobile/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>445</string>
<string>446</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/uPortMobileTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>445</string>
<string>446</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion lib/kancha/components/Scanner/Scanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface ScannerProps {
/**
* Camera has permission
*/
hasPermission: boolean
hasPermission: boolean | null
}

const NoPermission = () => {
Expand Down
13 changes: 6 additions & 7 deletions lib/screens/Scanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface ScannerScreenProps {
interface ScannerScreenState {
isEnabled: boolean
appState: string
hasPermission: null | string
hasPermission: null | boolean
}

export class ScannerScreen extends React.Component<ScannerScreenProps, ScannerScreenState> {
Expand All @@ -48,14 +48,13 @@ export class ScannerScreen extends React.Component<ScannerScreenProps, ScannerSc
async componentDidMount() {
AppState.addEventListener('change', this._handleAppStateChange)

const hasPermission = await Permissions.check('camera')
let status = await Permissions.check('camera')

if (hasPermission !== 'authorized') {
const request = await Permissions.request('camera')
this.setState({ hasPermission: request })
if (status === 'undetermined') {
status = await Permissions.request('camera')
}

this.setState({ hasPermission })
this.setState({ ...this.state, hasPermission: status === 'authorized' })
}

componentWillUnmount() {
Expand Down Expand Up @@ -131,7 +130,7 @@ export class ScannerScreen extends React.Component<ScannerScreenProps, ScannerSc
<Container flex={1}>
{this.state.appState === 'active' && (
<Scanner
hasPermission={this.state.hasPermission === 'authorized'}
hasPermission={this.state.hasPermission}
isEnabled={this.state.isEnabled}
onBarcodeRead={this.onBarCodeRead}
startScanner={this.startScanner}
Expand Down

0 comments on commit e5751af

Please sign in to comment.