Merge pull request #6993 from AlphaWallet/fix-tapping-on-tokenscript-action-button-doesnt-do-anything

Fix tapping on TokenScript action button doesn't do anything
pull/6994/head
Hwee-Boon Yar 1 year ago committed by GitHub
commit 3b4ea9bf58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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