alpha-wallet-ios icon indicating copy to clipboard operation
alpha-wallet-ios copied to clipboard

Move logic out of coordinators so they are primarily navigation/glue code between screens

Open hboon opened this issue 3 years ago • 3 comments

We have very fat coordinators.

Where possible, we should move logic out of coordinator, starting with those that can grouped together easily, eg. into something like AddCustomChain and supporting code in the same file.

Refactor bit by bit. Avoid huge PRs.

hboon avatar Feb 21 '22 04:02 hboon

AssetDefinitionStoreCoordinatorDelegate is used for showing errors and adding new scripts. AssetDefinitionStoreCoordinator appears to be used mainly for importing scripts and not navigation.

eviltofu avatar May 19 '22 06:05 eviltofu

PromptBackupCoordinator is used in AppCoordinator but is not stored in the coordinators variable. It's sort of left hanging there.

 walletAddressesStore
            .didRemoveWalletPublisher
            .receive(on: RunLoop.main)
            .sink { [weak self] account in
                guard let `self` = self else { return }

                self.config.deleteWalletName(forAccount: account.address)
                PromptBackupCoordinator(keystore: self.keystore, wallet: account, config: self.config, analyticsCoordinator: self.analyticsService).deleteWallet()
                TransactionsTracker.resetFetchingState(account: account, config: self.config)
                Erc1155TokenIdsFetcher.deleteForWallet(account.address)
                DatabaseMigration.removeRealmFiles(account: account)
                self.legacyFileBasedKeystore.delete(wallet: account)
                self.localStore.removeStore(forWallet: account)
            }.store(in: &cancelable)

eviltofu avatar May 19 '22 07:05 eviltofu

@eviltofu Would you help to update this list, with a short sentence and if there is one, link to the comment?

hboon avatar May 20 '22 05:05 hboon

Refer to #6606

hboon avatar Mar 28 '23 03:03 hboon