Skip to content

Commit

Permalink
camera bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
simplycash committed Jun 24, 2018
1 parent a13e76b commit 83e8028
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ export class HomePage {
}

async stopScan(keepPreview?: boolean) {
if (this.scanState === 'stopped' || this.scanState === 'destroying' || this.scanState === 'processing') {
if (this.scanState === 'stopped'
|| this.scanState === 'stopping'
|| this.scanState === 'willDestroy'
|| this.scanState === 'destroying'
|| this.scanState === 'processing') {
return
}
this.scanEndTime = new Date().getTime()
Expand Down Expand Up @@ -212,6 +216,7 @@ export class HomePage {
this.scanSub.unsubscribe() // stop scanning
if (!keepPreview) {
this.isTransparent = false
this.scanState = 'willDestroy'
window.setTimeout(() => {
this.destroyScanner()
}, 200)
Expand Down

0 comments on commit 83e8028

Please sign in to comment.