We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f8b8b2c + 5783199 commit ff2cc61Copy full SHA for ff2cc61
Adamant/Services/NodesStorage.swift
@@ -92,8 +92,14 @@ final class NodesStorage: NodesStorageProtocol {
92
init(securedStore: SecuredStore) {
93
self.securedStore = securedStore
94
95
+ var nodes = securedStore.get(StoreKey.NodesStorage.nodes) ?? Self.defaultItems
96
+ let nodesToAdd = Self.defaultItems.filter { defaultNode in
97
+ !nodes.contains { $0.node.host == defaultNode.node.host }
98
+ }
99
+ nodes.append(contentsOf: nodesToAdd)
100
+
101
_items = .init(wrappedValue: .init(
- wrappedValue: securedStore.get(StoreKey.NodesStorage.nodes) ?? Self.defaultItems
102
+ wrappedValue: nodes
103
))
104
105
subscription = items.removeDuplicates().sink { [weak self] in
0 commit comments