[OpenSea] release latest promise on its completion #4595

pull/4596/head
Krypto Pank 3 years ago
parent 2b5b3f1e41
commit 0503d0dc66
  1. 5
      AlphaWallet/Core/NFT/OpenSea/OpenSea.swift

@ -23,8 +23,7 @@ final class OpenSea {
let key: AddressAndRPCServer = .init(address: wallet.address, server: server)
guard OpenSea.isServerSupported(key.server) else {
cachedPromises[key] = .value([:])
return cachedPromises[key]!
return .value([:])
}
return makeFetchPromise(for: key)
@ -66,6 +65,8 @@ final class OpenSea {
}
return storage?.value[key] ?? result.result
}).ensure(on: queue, {
self.cachedPromises[key] = .none
})
}

Loading…
Cancel
Save