Skip to content

Commit

Permalink
Fix/name persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
isordo authored and godenzim committed Jul 17, 2023
1 parent 3449648 commit 097aab8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class ContactBookContactsDetailPage {
this.contact.addedFrom = AddType.SIGNING
} else if (state.addType && state.addType === AddType.QR && state.address && state.address.length > 0) {
this.contact.address = state.address
this.contact.name = state.name
this.contact.addedFrom = AddType.QR
} else {
this.contact.addedFrom = AddType.MANUAL
Expand Down Expand Up @@ -101,6 +102,6 @@ export class ContactBookContactsDetailPage {
}

onClickQRCode() {
this.navigationService.route('/contact-book-scan')
this.navigationService.routeWithState('/contact-book-scan', { name: this.contact.name })
}
}
3 changes: 2 additions & 1 deletion src/app/pages/contact-book-scan/contact-book-scan.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ export class ContactBookScanPage extends ScanBasePage {

public async checkScan(data: string): Promise<boolean | void> {
if (data.length > 0) {
const name = await this.navigationService.getState().name ?? ''
this.ngZone.run(async () => {
this.resetScannerPage()
this.stopScan()
await this.navigationService
.routeWithState('/contact-book-contacts-detail', { isNew: true, address: data, addType: AddType.QR })
.routeWithState('/contact-book-contacts-detail', { isNew: true, address: data, addType: AddType.QR, name })
.catch(handleErrorLocal(ErrorCategory.IONIC_NAVIGATION))
})
}
Expand Down

0 comments on commit 097aab8

Please sign in to comment.