Skip to content
Merged

fix #147

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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eudistack-wallet-ui",
"version": "2.0.11",
"version": "2.0.12",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
Expand Down
55 changes: 36 additions & 19 deletions src/app/pages/credentials/credentials.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export class CredentialsPage implements OnInit, ViewWillLeave {
}),

catchError((error: ExtendedHttpErrorResponse) => {
this.websocket.closeNotificationConnection();
this.handleContentExecutionError(error);
return of(null);
})
Expand All @@ -200,26 +201,41 @@ export class CredentialsPage implements OnInit, ViewWillLeave {
}

public sameDeviceVcActivationFlow(): void {
this.websocket.connectPinSocket()
.then(() => {
console.info('Requesting Credential Offer via same-device flow.');
this.walletService.requestOpenidCredentialOffer(this.credentialOfferUri).subscribe({
next: () => {
this.handleActivationSuccess().subscribe(() => {
this.router.navigate(['/tabs/credentials']);
this.websocket.closePinConnection();
});
},
error: (err) => {
console.error(err);
this.websocket.closePinConnection();
},
});
})
.catch(err => {
this.handleContentExecutionError(err)
})
const socketsToConnect: Promise<void>[] = [
this.websocket.connectPinSocket(),
this.websocket.connectNotificationSocket(),
];

from(Promise.all(socketsToConnect))
.pipe(
tap(() => {
console.info('Requesting Credential Offer via same-device flow.');
}),

switchMap(() =>
this.walletService.requestOpenidCredentialOffer(this.credentialOfferUri)
),

switchMap(() => this.handleActivationSuccess()),

switchMap(() =>
from(this.router.navigate(['/tabs/credentials']))
),

finalize(() => {
this.websocket.closePinConnection();
}),

catchError((err: ExtendedHttpErrorResponse) => {
console.error(err);
this.websocket.closeNotificationConnection();
this.handleContentExecutionError(err);
return of(null);
})
)
.subscribe();
}


private handleActivationSuccess(): Observable<VerifiableCredential[]> {
this.loader.addLoadingProcess();
Expand Down Expand Up @@ -254,6 +270,7 @@ export class CredentialsPage implements OnInit, ViewWillLeave {
}
}
return cred;

});
// todo avoid this
this.cdr.detectChanges();
Expand Down
8 changes: 7 additions & 1 deletion src/theme/customAlert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,19 @@ ion-alert.custom-alert-error .alert-wrapper {
font-weight: bold;
}

ion-alert .cred-preview {
ion-alert .alert-message div.cred-preview {
margin-top: 12px;
display: flex;
flex-direction: column;
gap: 10px;
}

@media (min-width: 768px) {
ion-alert .alert-message .cred-preview {
align-items: flex-start;
}
}

ion-alert.custom-alert-credential .cred-row {
display: grid;
grid-template-columns: max-content 1fr;
Expand Down
Loading