Skip to content

Commit

Permalink
fix reef controller selection
Browse files Browse the repository at this point in the history
  • Loading branch information
bnsports committed Feb 13, 2024
1 parent 526630d commit 6cc04b2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ extension ClaimCrowdloanRewardsPresenter: ClaimCrowdloanRewardsViewOutput {
func didLoad(view: ClaimCrowdloanRewardsViewInput) {
self.view = view
interactor.setup(with: self)

interactor.estimateFee()

provideStakeAmountViewModel()
Expand Down Expand Up @@ -159,15 +158,11 @@ extension ClaimCrowdloanRewardsPresenter: ClaimCrowdloanRewardsInteractorOutput
logger?.error("Vesting claim fee error: \(error.localizedDescription)")
}

func didReceiveTxHash(_ txHash: String) {
guard let view else { return }
router.presentDone(
chainAsset: chainAsset,
title: R.string.localizable.transactionSuccessful(preferredLanguages: selectedLocale.rLanguages),
description: nil,
extrinsicHash: txHash,
from: view,
closure: nil
func didReceiveTxHash(_: String) {
router.complete(
on: view,
title: "hash",
chainAsset: chainAsset
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ protocol ClaimCrowdloanRewardsInteractorOutput: AnyObject {
func didReceiveAccountInfo(accountInfo: AccountInfo?)
}

protocol ClaimCrowdloanRewardsRouterInput: AnyObject, AllDonePresentable, SheetAlertPresentable, ErrorPresentable, AnyDismissable {}
protocol ClaimCrowdloanRewardsRouterInput: AnyObject, SheetAlertPresentable, ErrorPresentable, AnyDismissable {
func complete(
on view: ControllerBackedProtocol?,
title: String,
chainAsset: ChainAsset
)
}

protocol ClaimCrowdloanRewardsModuleInput: AnyObject {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
import Foundation
import SSFModels
import SoraUI

final class ClaimCrowdloanRewardsRouter: ClaimCrowdloanRewardsRouterInput {}
final class ClaimCrowdloanRewardsRouter: ClaimCrowdloanRewardsRouterInput {
func complete(
on view: ControllerBackedProtocol?,
title: String,
chainAsset: ChainAsset
) {
let presenter = view?.controller.presentingViewController

let controller = AllDoneAssembly.configureModule(chainAsset: chainAsset, hashString: title)?.view.controller
controller?.modalPresentationStyle = .custom

let factory = ModalSheetBlurPresentationFactory(
configuration: ModalSheetPresentationConfiguration.fearlessBlur
)
controller?.modalTransitioningFactory = factory

view?.controller.dismiss(animated: true) {
if let presenter = presenter as? ControllerBackedProtocol,
let controller = controller {
presenter.controller.present(controller, animated: true)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ extension ControllerAccountInteractor: ControllerAccountInteractorInputProtocol
private func createLedgerFetchOperation(_ accountId: AccountId) -> CompoundOperationWrapper<StakingLedger?> {
let coderFactoryOperation = runtimeService.fetchCoderFactoryOperation()

let wrapper: CompoundOperationWrapper<[StorageResponse<StakingLedger>]> = storageRequestFactory.queryItems(
guard let wrapper: CompoundOperationWrapper<[StorageResponse<StakingLedger>]> = chainAsset.chain.stakingSettings?.queryItems(
engine: engine,
keyParams: { [accountId] },
factory: { try coderFactoryOperation.extractNoCancellableResultData() },
storagePath: .stakingLedger
)
storagePath: .stakingLedger,
using: storageRequestFactory
) else {
return CompoundOperationWrapper.createWithResult(nil)
}

let mapOperation = ClosureOperation<StakingLedger?> {
try wrapper.targetOperation.extractNoCancellableResultData().first?.value
Expand Down

0 comments on commit 6cc04b2

Please sign in to comment.