Fix tapping on TokenScript action button doesn't do anything

pull/6993/head
Hwee-Boon Yar 1 year ago
parent 9cb3879871
commit 198b4d060a
  1. 8
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/AssetInternalValue.swift

@ -1,5 +1,6 @@
// Copyright © 2019 Stormbird PTE. LTD.
import Combine
import Foundation
import AlphaWalletAddress
import AlphaWalletCore
@ -165,6 +166,7 @@ public enum AssetInternalValue: Codable {
}
}
fileprivate var assetInternalValueCancellables = Set<AnyCancellable>()
extension Array where Element == Subscribable<AssetInternalValue> {
public func createPromiseForSubscribeOnce() -> Promise<Void> {
guard !isEmpty else { return .value(Void()) }
@ -174,11 +176,13 @@ extension Array where Element == Subscribable<AssetInternalValue> {
each.publisher
.first()
.ignoreOutput()
.sink(receiveValue: { _ in
.sink(receiveCompletion: { state in
count += 1
guard count == self.count else { return }
seal.fulfill(Void())
})
}, receiveValue: { _ in
//no-op
}).store(in: &assetInternalValueCancellables)
}
}
}

Loading…
Cancel
Save