Skip to content

Commit

Permalink
Hide errors if issues with the API results
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreb committed Mar 14, 2022
1 parent 3fe3d2b commit 3e644e6
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ export class TickerComponent implements OnInit, OnDestroy {
}

navigator = (obj, path) => {
for (var i = 0, path = path.split('.'), len = path.length; i < len; i++) {
if (Array.isArray((obj[path[i]]))) {
obj = obj[path[i]][path[i + 1]];
i++;
} else {
obj = obj[path[i]];
}
};
return obj;
try {
for (var i = 0, path = path.split('.'), len = path.length; i < len; i++) {
if (Array.isArray((obj[path[i]]))) {
obj = obj[path[i]][path[i + 1]];
i++;
} else {
obj = obj[path[i]];
}
};
return obj;
}
catch (err) {
console.error(err);
}
};

async updateTicker() {
Expand Down

0 comments on commit 3e644e6

Please sign in to comment.