Skip to content

Commit

Permalink
Merge PR#85 : Fix browser keys method using .length
Browse files Browse the repository at this point in the history
  • Loading branch information
alokrajiv committed Oct 11, 2017
2 parents de2140e + b0083c7 commit 86386cd
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions www/LocalStorageHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,8 @@ function LocalStorageHandle(success, error, intent, operation, args) {
}
} else if (operation === 'keys') {
var keys = [];
var key = localStorage.key(0);
if(!key) {
return success(keys);
}
var i = 0;
while(key) {
keys.push(key);
i++;
key = localStorage.key(i);
for(var i = 0; i < localStorage.length; i++){
keys.push(localStorage.key(i));
}
success(keys);
}
Expand Down

0 comments on commit 86386cd

Please sign in to comment.