Skip to content

Commit

Permalink
fix keepass record referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Jun 30, 2018
1 parent 3ec70b2 commit 06eb977
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/web/src/app/+options/keepass-reference.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {catchError, map, take} from "rxjs/operators";
import {catchError, map, switchMap, take} from "rxjs/operators";
import {Observable, of} from "rxjs";
import {Component, EventEmitter, Input, Output} from "@angular/core";
import {FormControl, FormGroup, Validators} from "@angular/forms";
Expand Down Expand Up @@ -41,18 +41,18 @@ export class KeePassReferenceComponent {
private electronService: ElectronService) {}

// TODO consider moving this to the "effects" service, ie keep a component dump by interacting with the "store" only
submit() {
async submit() {
const keePassRef = {
url: this.url.value,
uuid: this.uuid.value,
};

this.referencing = true;

this.keePassClientConf$
.pipe(take(1))
.subscribe((keePassClientConf) => {
this.electronService
await this.keePassClientConf$
.pipe(
take(1),
switchMap((keePassClientConf) => this.electronService
.keePassPassword(keePassClientConf, keePassRef)
.pipe(
map(({password, message}) => {
Expand All @@ -72,9 +72,9 @@ export class KeePassReferenceComponent {
this.store.dispatch(failAction);
return of(failAction);
}),
take(1),
);
});
)),
)
.toPromise();
}

unlink() {
Expand Down

0 comments on commit 06eb977

Please sign in to comment.