gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[reclaim-ui] 259/459: fix attribute updates and display


From: gnunet
Subject: [reclaim-ui] 259/459: fix attribute updates and display
Date: Fri, 11 Jun 2021 23:25:51 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository reclaim-ui.

commit 98e83f7f85a4dfa14c80c7b4e7c8d59252aff5af
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Tue Aug 4 22:30:15 2020 +0200

    fix attribute updates and display
---
 src/app/edit-identity/edit-identity.component.ts | 14 ++++++++++----
 src/app/identity-list/identity-list.component.ts | 11 +++++++++--
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index e81004f..329c251 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -92,11 +92,11 @@ export class EditIdentityComponent implements OnInit {
       let i;
       this.attributes = attributes;
       for (i = 0; i < attributes.length; i++) {
-        if ((attributes[i].attestation === '') &&
+        if ((attributes[i].flag === '0') &&
             this.oidcService.getScope().includes(attributes[i].name)) {
           this.requestedAttributes.push(attributes[i]);
         }
-        if ((attributes[i].attestation !== '') &&
+        if ((attributes[i].flag === '1') &&
             this.oidcService.getAttestedScope().includes(attributes[i].name)) {
           this.requestedAttested.push(attributes[i]);
         }
@@ -329,8 +329,14 @@ export class EditIdentityComponent implements OnInit {
     if (undefined === this.requestedAttributes) {
       return false;
     }
-    return this.oidcService.getScope().length !==
-      this.requestedAttributes.length;
+    var scopes = this.oidcService.getScope();
+    for (var i = 0; i < this.requestedAttributes.length; i++) {
+      if (!scopes.includes(this.requestedAttributes[i].name))
+      {
+        return true;
+      }
+    }
+    return false;
   }
 
   private saveIdentityAttested() {
diff --git a/src/app/identity-list/identity-list.component.ts 
b/src/app/identity-list/identity-list.component.ts
index 9b333b9..6ca1dbf 100644
--- a/src/app/identity-list/identity-list.component.ts
+++ b/src/app/identity-list/identity-list.component.ts
@@ -152,6 +152,7 @@ export class IdentityListComponent implements OnInit {
     this.reclaimService.getAttributes(identity).subscribe(attributes => {
       this.attributes[identity.pubkey] = [];
       this.requestedAttributes[identity.pubkey] = [];
+      this.requestedAttested = [];
       if (attributes === null) {
         this.getMissingAttributes(identity);
         return;
@@ -247,8 +248,14 @@ export class IdentityListComponent implements OnInit {
     if (undefined === this.requestedAttributes[identity.pubkey]) {
       return false;
     }
-    return this.getScopes().length !==
-      this.requestedAttributes[identity.pubkey].length;
+    var scopes = this.getScopes();
+    for (var i = 0; i < this.requestedAttributes[identity.pubkey].length; i++) 
{
+      if (!scopes.includes(this.requestedAttributes[identity.pubkey][i].name))
+        {
+        return true;
+      }
+    }
+    return false;
   }
 
   hasAttributes(identity) {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]