diff --git a/src/app/modules/main/module.nim b/src/app/modules/main/module.nim index e4c9c269b0..9a284fe0e0 100644 --- a/src/app/modules/main/module.nim +++ b/src/app/modules/main/module.nim @@ -69,7 +69,12 @@ proc newModule*[T]( ) result.walletSectionModule = wallet_section_module.newModule[Module[T]]( - result, tokenService, transactionService, collectible_service, walletAccountService + result, + events, + tokenService, + transactionService, + collectible_service, + walletAccountService ) @@ -102,10 +107,11 @@ method load*[T](self: Module[T]) = for cModule in self.communitySectionsModule.values: cModule.load() - self.walletSectionModule.load() let walletSectionItem = initItem("wallet", ChatSectionType.Wallet.int, "Wallet", "", "wallet", "", 0, 0) self.view.addItem(chatSectionItem) + self.walletSectionModule.load() + proc checkIfModuleDidLoad [T](self: Module[T]) = diff --git a/src/app/modules/main/wallet_section/account_tokens/module.nim b/src/app/modules/main/wallet_section/account_tokens/module.nim index 920799f36e..abe6763d67 100644 --- a/src/app/modules/main/wallet_section/account_tokens/module.nim +++ b/src/app/modules/main/wallet_section/account_tokens/module.nim @@ -1,3 +1,4 @@ +import eventemitter import ./io_interface, ./view export io_interface @@ -8,7 +9,7 @@ type view: View moduleLoaded: bool -proc newModule*[T](delegate: T): Module[T] = +proc newModule*[T](delegate: T, events: EventEmitter): Module[T] = result = Module[T]() result.delegate = delegate result.view = newView(result) diff --git a/src/app/modules/main/wallet_section/accounts/module.nim b/src/app/modules/main/wallet_section/accounts/module.nim index fae63721bb..85985d83f1 100644 --- a/src/app/modules/main/wallet_section/accounts/module.nim +++ b/src/app/modules/main/wallet_section/accounts/module.nim @@ -1,3 +1,5 @@ +import eventemitter + import ./io_interface, ./view export io_interface @@ -8,7 +10,7 @@ type view: View moduleLoaded: bool -proc newModule*[T](delegate: T): Module[T] = +proc newModule*[T](delegate: T, events: EventEmitter): Module[T] = result = Module[T]() result.delegate = delegate result.view = newView() diff --git a/src/app/modules/main/wallet_section/all_tokens/module.nim b/src/app/modules/main/wallet_section/all_tokens/module.nim index ba3abad5e7..470d96404b 100644 --- a/src/app/modules/main/wallet_section/all_tokens/module.nim +++ b/src/app/modules/main/wallet_section/all_tokens/module.nim @@ -1,5 +1,7 @@ import sequtils, sugar +import eventemitter + import ./io_interface, ./view, ./controller, ./item import ../../../../../app_service/service/token/service as token_service @@ -12,7 +14,7 @@ type controller: controller.AccessInterface moduleLoaded: bool -proc newModule*[T](delegate: T, tokenService: token_service.ServiceInterface): Module[T] = +proc newModule*[T](delegate: T, events: EventEmitter, tokenService: token_service.ServiceInterface): Module[T] = result = Module[T]() result.delegate = delegate result.view = newView(result) diff --git a/src/app/modules/main/wallet_section/collectibles/module.nim b/src/app/modules/main/wallet_section/collectibles/module.nim index 01c48141d0..1977be7e5d 100644 --- a/src/app/modules/main/wallet_section/collectibles/module.nim +++ b/src/app/modules/main/wallet_section/collectibles/module.nim @@ -1,9 +1,11 @@ +import eventemitter + import ./io_interface, ./view import ../../../../../app_service/service/collectible/service as collectible_service -import collectible/module as collectible_module -import collections/module as collections_module -import collectibles/module as collectibles_module +import ./collectible/module as collectible_module +import ./collections/module as collections_module +import ./collectibles/module as collectibles_module export io_interface @@ -19,6 +21,7 @@ type proc newModule*[T]( delegate: T, + events: EventEmitter, collectibleService: collectible_service.ServiceInterface ): Module[T] = result = Module[T]() diff --git a/src/app/modules/main/wallet_section/main_account/module.nim b/src/app/modules/main/wallet_section/main_account/module.nim index fae63721bb..85985d83f1 100644 --- a/src/app/modules/main/wallet_section/main_account/module.nim +++ b/src/app/modules/main/wallet_section/main_account/module.nim @@ -1,3 +1,5 @@ +import eventemitter + import ./io_interface, ./view export io_interface @@ -8,7 +10,7 @@ type view: View moduleLoaded: bool -proc newModule*[T](delegate: T): Module[T] = +proc newModule*[T](delegate: T, events: EventEmitter): Module[T] = result = Module[T]() result.delegate = delegate result.view = newView() diff --git a/src/app/modules/main/wallet_section/module.nim b/src/app/modules/main/wallet_section/module.nim index 809986f8f6..efd7912e0f 100644 --- a/src/app/modules/main/wallet_section/module.nim +++ b/src/app/modules/main/wallet_section/module.nim @@ -1,3 +1,5 @@ +import eventemitter + import ./io_interface as io_ingerface import ./view @@ -32,6 +34,7 @@ type proc newModule*[T]( delegate: T, + events: EventEmitter, tokenService: token_service.Service, transactionService: transaction_service.Service, collectibleService: collectible_service.Service, @@ -42,12 +45,12 @@ proc newModule*[T]( result.view = newView() result.moduleLoaded = false - result.accountTokensModule = account_tokens_module.newModule(result) - result.accountsModule = accounts_module.newModule(result) - result.allTokensModule = all_tokens_module.newModule(result, tokenService) - result.collectiblesModule = collectibles_module.newModule(result, collectibleService) - result.mainAccountModule = main_account_module.newModule(result) - result.transactionsModule = transactions_module.newModule(result, transactionService) + result.accountTokensModule = account_tokens_module.newModule(result, events) + result.accountsModule = accounts_module.newModule(result, events) + result.allTokensModule = all_tokens_module.newModule(result, events, tokenService) + result.collectiblesModule = collectibles_module.newModule(result, events, collectibleService) + result.mainAccountModule = main_account_module.newModule(result, events) + result.transactionsModule = transactions_module.newModule(result, events, transactionService) method delete*[T](self: Module[T]) = self.accountTokensModule.delete diff --git a/src/app/modules/main/wallet_section/transactions/module.nim b/src/app/modules/main/wallet_section/transactions/module.nim index d30be59bbe..aec259b4d1 100644 --- a/src/app/modules/main/wallet_section/transactions/module.nim +++ b/src/app/modules/main/wallet_section/transactions/module.nim @@ -1,3 +1,5 @@ +import eventemitter + import ./io_interface, ./view, ./controller import ../../../../../app_service/service/transaction/service as transaction_service @@ -10,7 +12,11 @@ type controller: controller.AccessInterface moduleLoaded: bool -proc newModule*[T](delegate: T, transactionService: transaction_service.ServiceInterface): Module[T] = +proc newModule*[T]( + delegate: T, + events: EventEmitter, + transactionService: transaction_service.ServiceInterface +): Module[T] = result = Module[T]() result.delegate = delegate result.view = newView(result)