-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make protocol for token list service to separate list and noAccount s…
…tub without tokens - check if cell is first using original indexPath instead of table height
- Loading branch information
Showing
6 changed files
with
116 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...leWallet/UnstoppableWallet/Modules/Wallet/TokenList/NoAccountWalletTokenListService.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Combine | ||
import ComponentKit | ||
import HsExtensions | ||
import RxSwift | ||
|
||
class NoAccountWalletTokenListService: IWalletTokenListService { | ||
let reachabilityManager: IReachabilityManager | ||
let balancePrimaryValueManager: BalancePrimaryValueManager | ||
|
||
var state: WalletTokenListService.State = .noAccount | ||
var stateUpdatedPublisher: AnyPublisher<WalletTokenListService.State, Never> { | ||
Just(state).eraseToAnyPublisher() | ||
} | ||
|
||
init(reachabilityManager: IReachabilityManager, balancePrimaryValueManager: BalancePrimaryValueManager) { | ||
self.reachabilityManager = reachabilityManager | ||
self.balancePrimaryValueManager = balancePrimaryValueManager | ||
} | ||
|
||
} | ||
|
||
extension NoAccountWalletTokenListService { | ||
|
||
var isReachable: Bool { | ||
reachabilityManager.isReachable | ||
} | ||
|
||
var balancePrimaryValueObservable: Observable<BalancePrimaryValue> { | ||
balancePrimaryValueManager.balancePrimaryValueObservable | ||
} | ||
|
||
var balancePrimaryValue: BalancePrimaryValue { | ||
balancePrimaryValueManager.balancePrimaryValue | ||
} | ||
|
||
var itemUpdatedObservable: Observable<WalletTokenListService.Item> { | ||
.never() | ||
} | ||
|
||
func item(element: WalletModule.Element) -> WalletTokenListService.Item? { | ||
nil | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters