Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/admin/admin.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ export class AdminComponent implements OnInit {
this.userProfileEntryResponseToUpdate?.StakeMultipleBasisPoints || 1.25 * 100 * 100;
return this.backendApi
.UpdateProfile(
environment.verificationEndpointHostname,
environment.verificationEndpointHostname ? environment.verificationEndpointHostname : this.globalVars.localNode,
this.globalVars.loggedInUser.PublicKeyBase58Check /*UpdaterPublicKeyBase58Check*/,
this.changeUsernamePublicKey /*ProfilePublicKeyBase58Check*/,
// Start params
Expand Down
46 changes: 27 additions & 19 deletions src/app/backend-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,27 @@ export class BackendApiService {
this.identityService.identityServicePublicKeyAdded = publicKeyAdded;
}

// Launch Approve window in identity if necessary
launchApproveWindow(signed, res): Observable<any> {
if (signed.approvalRequired) {
return this.identityService
.launch("/approve", {
tx: res.TransactionHex,
btcTx: res.btcTx,
ethTx: res.ethTx,
publicKey: res.publicKey,
})
.pipe(
map((approved) => {
this.setIdentityServiceUsers(approved.users);
return { ...res, ...approved };
})
);
} else {
return of({ ...res, ...signed });
}
}

signAndSubmitTransaction(endpoint: string, request: Observable<any>, PublicKeyBase58Check: string): Observable<any> {
return request
.pipe(
Expand All @@ -489,24 +510,7 @@ export class BackendApiService {
transactionHex: res.TransactionHex,
...this.identityService.identityServiceParamsForKey(PublicKeyBase58Check),
})
.pipe(
switchMap((signed) => {
if (signed.approvalRequired) {
return this.identityService
.launch("/approve", {
tx: res.TransactionHex,
})
.pipe(
map((approved) => {
this.setIdentityServiceUsers(approved.users);
return { ...res, ...approved };
})
);
} else {
return of({ ...res, ...signed });
}
})
)
.pipe(switchMap((signed) => this.launchApproveWindow(signed, res)))
)
)
.pipe(
Expand Down Expand Up @@ -626,7 +630,11 @@ export class BackendApiService {
...this.identityService.identityServiceParamsForKey(PublicKeyBase58Check),
unsignedHashes: res.UnsignedHashes,
})
.pipe(map((signed) => ({ ...res, ...signed })))
.pipe(
map((signed) =>
this.launchApproveWindow(signed, { btcTx: res.UnsignedHashes[0], publicKey: PublicKeyBase58Check })
)
)
)
);

Expand Down
Loading