Skip to content

Commit

Permalink
fix(nodes): fix runtime error when new coin added
Browse files Browse the repository at this point in the history
  • Loading branch information
bludnic committed Jun 24, 2024
1 parent eb19ad8 commit 73d3ff7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/nodes/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ export const nodesStorage = {
getUseFastest(node: NodeType) {
const options = optionsStorage.getItem()

return options[node].useFastest
return !!options[node]?.useFastest
},
setUseFastest(value: boolean, node: NodeType) {
const options = optionsStorage.getItem()

if (!options[node]) {
options[node] = { useFastest: value }
}
options[node].useFastest = value

optionsStorage.setItem(options)
Expand Down

0 comments on commit 73d3ff7

Please sign in to comment.