js: fix confusion about loop in last commit
authorMaximilian Krambach <maximilian.krambach@intevation.de>
Tue, 31 Jul 2018 15:35:52 +0000 (17:35 +0200)
committerMaximilian Krambach <maximilian.krambach@intevation.de>
Tue, 31 Jul 2018 15:35:52 +0000 (17:35 +0200)
--

* The aim is to iterate through the results of the first request
 (all keys), and then add the propert 'hasSecret' to those that
  are in the second request (secret Keysring)  as well. I messed
  this up in a recent change, and it escaped testing.

lang/js/src/Keyring.js

index 8715a47..d25216c 100644 (file)
@@ -79,9 +79,8 @@ export class GPGME_Keyring {
                             };
                         }
                         secondrequest().then(function(answer) {
-                            for (let i=0; i < answer.keys.length; i++){
+                            for (let i=0; i < result.keys.length; i++){
                                 if (prepare_sync === true){
-                                    result.keys[i].hasSecret = undefined;
                                     if (answer && answer.keys) {
                                         for (let j=0;
                                             j < answer.keys.length; j++ ){