Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
changed while to for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
pabelnl committed Jun 6, 2020
1 parent 046fc2c commit 0eff762
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/rpc/providers/pocket-rpc-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ export class PocketRpcProvider implements IRPCProvider {
let result = relayResponse.payload
try {
result = JSON.parse(result)
let count = 0
while (typeGuard(result, "string") || count == 10) {
result = JSON.parse(result)
count++

for (let index = 0; index <= 10; index++) {
if (typeGuard(result, "string")) {
result = JSON.parse(result)
}
}

return result
Expand Down

0 comments on commit 0eff762

Please sign in to comment.