Code cleaned up

- This is massive cleanup of all commented code from iOS 16 navigation changes
- A few fixes along the way
This commit is contained in:
Lukas Korba 2025-04-19 09:47:02 +02:00
parent 3b3eae9c83
commit fbe119040a
179 changed files with 246 additions and 4594 deletions

View File

@ -71,7 +71,6 @@ let package = Package(
.library(name: "ShieldingProcessor", targets: ["ShieldingProcessor"]),
.library(name: "SmartBanner", targets: ["SmartBanner"]),
.library(name: "SupportDataGenerator", targets: ["SupportDataGenerator"]),
.library(name: "SyncProgress", targets: ["SyncProgress"]),
.library(name: "ReadTransactionsStorage", targets: ["ReadTransactionsStorage"]),
.library(name: "TaxExporter", targets: ["TaxExporter"]),
.library(name: "TransactionDetails", targets: ["TransactionDetails"]),
@ -208,7 +207,6 @@ let package = Package(
"PartialProposalError",
"SDKSynchronizer",
"ShieldingProcessor",
"SyncProgress",
"UIComponents",
"Utils",
"WalletBalances",
@ -420,7 +418,6 @@ let package = Package(
"Settings",
"ShieldingProcessor",
"SmartBanner",
"SyncProgress",
"TransactionList",
"UIComponents",
"UserPreferencesStorage",
@ -900,18 +897,6 @@ let package = Package(
],
path: "Sources/Dependencies/SupportDataGenerator"
),
.target(
name: "SyncProgress",
dependencies: [
"Generated",
"Models",
"SDKSynchronizer",
"UIComponents",
"Utils",
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
],
path: "Sources/Features/SyncProgress"
),
.target(
name: "ReadTransactionsStorage",
dependencies: [

View File

@ -1,6 +1,6 @@
//
// AppVersionInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// AppVersionLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// AppVersionMocks.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// AudioServicesInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// AudioServicesLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// AudioServicesTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// BalanceFormatterInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// BalanceFormatterLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 14.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// BalanceFormatterTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 14.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// CaptureDeviceInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// CaptureDeviceLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// CaptureDeviceTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DatabaseFiles.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 05.04.2022.
//

View File

@ -1,6 +1,6 @@
//
// DatabaseFilesInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DatabaseFilesLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DatabaseFilesTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DateClient.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 04.04.2023.
//

View File

@ -1,6 +1,6 @@
//
// DateLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 04.04.2023.
//

View File

@ -1,6 +1,6 @@
//
// DateTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// Deeplink.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.06.2022.
//

View File

@ -1,6 +1,6 @@
//
// DeeplinkInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DeeplinkLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DeeplinkTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 11.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DerivationToolInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DerivationToolLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DerivationToolTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DiskSpaceChecker.swift
// secant-testnet
// Zashi
//
// Created by Michal Fousek on 28.09.2022.
//

View File

@ -1,6 +1,6 @@
//
// DiskSpaceCheckerInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 10.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DiskSpaceCheckerLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 10.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DiskSpaceCheckerMocks.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 10.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// DiskSpaceCheckerTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 10.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// FeedbackGeneratorInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 14.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// FeedbackGeneratorLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 14.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// FeedbackGeneratorTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 14.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// FileManagerClient.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 07.04.2022.
//

View File

@ -1,6 +1,6 @@
//
// FileManagerLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// FileManagerTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// LocalAuthenticationInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// LocalAuthenticationLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// LocalAuthenticationMocks.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// LocalAuthenticationTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// LogsHandlerInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 30.01.2023.
//

View File

@ -1,6 +1,6 @@
//
// LogsHandlerLive.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 30.01.2023.
//

View File

@ -1,6 +1,6 @@
//
// LogsHandlerTest.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 30.01.2023.
//

View File

@ -1,6 +1,6 @@
//
// MnemonicInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// MnemonicLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// MnemonicMocks.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// MnemonicTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// NumberFormatterInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// NumberFormatterLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 14.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// NumberFormatterTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 14.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// PasteboardInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// PasteboardLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// PasteboardTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// QRImageDetectorInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 2024-04-18.
//

View File

@ -1,6 +1,6 @@
//
// QRImageDetectorLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 2024-04-18.
//

View File

@ -1,6 +1,6 @@
//
// QRImageDetectorTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 2024-04-18.
//

View File

@ -1,6 +1,6 @@
//
// ReviewRequestInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 3.4.2023.
//

View File

@ -1,6 +1,6 @@
//
// ReviewRequestLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 3.4.2023.
//

View File

@ -1,6 +1,6 @@
//
// ReviewRequestTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 3.4.2023.
//

View File

@ -1,6 +1,6 @@
//
// SDKSynchronizerClient.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.04.2022.
//

View File

@ -1,6 +1,6 @@
//
// SDKSynchronizerLive.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// SDKSynchronizerTest.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// SecItemClient.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 12.04.2022.
//

View File

@ -1,6 +1,6 @@
//
// SecItemLive.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -61,13 +61,7 @@ extension ShieldingProcessorClient: DependencyKey {
let spendingKey = try derivationTool.deriveSpendingKey(seedBytes, zip32AccountIndex, zcashSDKEnvironment.network.networkType)
let proposal = try await sdkSynchronizer.proposeShielding(account.id, zcashSDKEnvironment.shieldingThreshold, .empty, nil)
// try? await Task.sleep(for: .seconds(4))
//subject.send(.succeeded)
// subject.send(.failed("parada".toZcashError()))
// subject.send(.grpc)
// return
guard let proposal else { throw "shieldFunds nil proposal" }
let result = try await sdkSynchronizer.createProposedTransactions(proposal, spendingKey)

View File

@ -1,6 +1,6 @@
//
// URIParser.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 17.05.2022.
//

View File

@ -1,6 +1,6 @@
//
// URIParserClient.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 17.05.2022.
//

View File

@ -1,6 +1,6 @@
//
// URIParserLive.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// URIParserTest.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// UserDefaultsInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// UserDefaultsLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// UserDefaultsTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// UserPreferencesStorage.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 03/18/2022.
//

View File

@ -1,6 +1,6 @@
//
// UserPreferencesStorageInterface.swift
// secant-testnet
// Zashi
//
// Created by Francisco Gindre on 2/6/23.
//

View File

@ -1,6 +1,6 @@
//
// UserPreferencesStorageLive.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// UserPreferencesStorageMocks.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// WalletStorage.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 03/10/2022.
//

View File

@ -1,6 +1,6 @@
//
// WalletStorageInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//
@ -81,11 +81,14 @@ public struct WalletStorageClient {
public var importUserMetadataEncryptionKeys: (UserMetadataEncryptionKeys, Account) throws -> Void
public var exportUserMetadataEncryptionKeys: (Account) throws -> UserMetadataEncryptionKeys
// Remind me
/// Wallet backup reminder set/get
public var importWalletBackupReminder: (ReminedMeTimestamp) throws -> Void
public var exportWalletBackupReminder: () -> ReminedMeTimestamp?
/// Shield transparent funds set/get
public var importShieldingReminder: (ReminedMeTimestamp, String) throws -> Void
public var exportShieldingReminder: (String) -> ReminedMeTimestamp?
/// Reset transparent funds reminder
public var resetShieldingReminder: (String) -> Void
}

View File

@ -1,6 +1,6 @@
//
// WalletStorageLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 15.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// WalletStorageTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 14.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// ZcashSDKEnvironmentInterface.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// ZcashSDKEnvironmentLiveKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -1,6 +1,6 @@
//
// ZcashSDKEnvironmentTestKey.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 13.11.2022.
//

View File

@ -61,9 +61,7 @@ public struct AboutView: View {
.onAppear { store.send(.onAppear) }
.zashiBack()
.screenTitle(L10n.Settings.about)
//..walletstatusPanel(background: .transparent)
}
//.navigationBarTitleDisplayMode(.inline)
.screenHorizontalPadding()
.applyScreenBackground()
}

View File

@ -109,18 +109,10 @@ public struct AddressBook {
Reduce { state, action in
switch action {
case .onAppear:
// state.originalName = ""
// state.originalAddress = ""
state.isValidForm = false
// state.isValidZcashAddress = false
state.deleteIdToConfirm = nil
// state.name = ""
// state.address = ""
state.nameAlreadyExists = false
state.addressAlreadyExists = false
// state.isAddressFocused = false
// state.isNameFocused = false
// state.scanState.checkers = [.zcashAddressScanChecker, .requestZecScanChecker]
if let editId = state.editId {
return .concatenate(
.send(.editId(editId)),
@ -145,7 +137,6 @@ public struct AddressBook {
state.isValidForm = false
state.isAddressFocused = true
return .none
// return .send(.updateDestination(.add))
case .checkDuplicates:
state.nameAlreadyExists = false
@ -161,25 +152,8 @@ public struct AddressBook {
return .none
case .scanButtonTapped:
// state.scanViewBinding = true
return .none
// case .scan(.found(let address)):
// state.address = address.data
// state.name = ""
// audioServices.systemSoundVibrate()
// state.scanViewBinding = false
// state.isNameFocused = true
//// return .send(.updateDestination(.add))
// return .none
// case .scan(.cancelTapped):
// state.scanViewBinding = false
// return .none
// case .scan:
// return .none
case .binding:
state.isValidZcashAddress = derivationTool.isZcashAddress(state.address, zcashSDKEnvironment.network.networkType)
state.isValidForm = !state.name.isEmpty && state.isValidZcashAddress
@ -256,7 +230,6 @@ public struct AddressBook {
)
} catch {
// TODO: [#1408] error handling https://github.com/Electric-Coin-Company/zashi-ios/issues/1408
// return .send(.updateDestination(nil))
}
return .none
@ -265,7 +238,6 @@ public struct AddressBook {
state.name = ""
state.isAddressFocused = false
state.isNameFocused = false
// return .send(.updateDestination(nil))
return .none
case .fetchABContactsRequested:

View File

@ -1,6 +1,6 @@
//
// BalancesStore.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 04.08.2022.
//
@ -25,8 +25,7 @@ public struct Balances {
public struct State: Equatable {
public var stateStreamCancelId = UUID()
public var shieldingProcessorCancelId = UUID()
@Presents public var alert: AlertState<Action>?
public var autoShieldingThreshold: Zatoshi
public var changePending: Zatoshi
public var isShielding: Bool
@ -77,18 +76,12 @@ public struct Balances {
@CasePathable
public enum Action: Equatable {
case alert(PresentationAction<Action>)
case dismissTapped
case onAppear
case onDisappear
// case proposalReadyForShieldingWithKeystone(Proposal)
case sheetHeightUpdated(CGFloat)
case shieldFundsTapped
case shieldingProcessorStateChanged(ShieldingProcessorClient.State)
// case shieldFunds
// case shieldFundsFailure(ZcashError)
// case shieldFundsSuccess
// case shieldFundsWithKeystone
case synchronizerStateChanged(RedactableSynchronizerState)
case updateBalance(AccountBalance?)
case updateBalances([AccountUUID: AccountBalance])
@ -109,16 +102,6 @@ public struct Balances {
public var body: some Reducer<State, Action> {
Reduce { state, action in
switch action {
case .alert(.presented(let action)):
return .send(action)
case .alert(.dismiss):
state.alert = nil
return .none
case .alert:
return .none
case .onAppear:
state.autoShieldingThreshold = zcashSDKEnvironment.shieldingThreshold
return .merge(
@ -171,75 +154,6 @@ public struct Balances {
case .shieldFundsTapped:
shieldingProcessor.shieldFunds()
return .none
// case .shieldFunds:
// guard let account = state.selectedWalletAccount, let zip32AccountIndex = account.zip32AccountIndex else {
// return .none
// }
// if account.vendor == .keystone {
// return .send(.shieldFundsWithKeystone)
// }
// // Regular path only for Zashi account
// state.isShieldingFunds = true
// return .run { send in
// do {
// let storedWallet = try walletStorage.exportWallet()
// let seedBytes = try mnemonic.toSeed(storedWallet.seedPhrase.value())
// let spendingKey = try derivationTool.deriveSpendingKey(seedBytes, zip32AccountIndex, zcashSDKEnvironment.network.networkType)
//
// let proposal = try await sdkSynchronizer.proposeShielding(account.id, zcashSDKEnvironment.shieldingThreshold, .empty, nil)
//
// guard let proposal else { throw "sdkSynchronizer.proposeShielding" }
//
// let result = try await sdkSynchronizer.createProposedTransactions(proposal, spendingKey)
//
// //await send(.walletBalances(.updateBalances))
//
// switch result {
// case .grpcFailure:
// await send(.shieldFundsFailure("sdkSynchronizer.createProposedTransactions-grpcFailure".toZcashError()))
// case let.failure(_, code, description):
// await send(.shieldFundsFailure("sdkSynchronizer.createProposedTransactions-failure \(code) \(description)".toZcashError()))
// case .partial:
// return
// case .success:
// await send(.shieldFundsSuccess)
// }
// } catch {
// await send(.shieldFundsFailure(error.toZcashError()))
// }
// }
//
// case .shieldFundsWithKeystone:
// guard let account = state.selectedWalletAccount else {
// return .none
// }
// return .run { send in
// do {
// let proposal = try await sdkSynchronizer.proposeShielding(account.id, zcashSDKEnvironment.shieldingThreshold, .empty, nil)
//
// guard let proposal else { throw "sdkSynchronizer.proposeShielding" }
// await send(.proposalReadyForShieldingWithKeystone(proposal))
// } catch {
// await send(.shieldFundsFailure(error.toZcashError()))
// }
// }
//
// case .proposalReadyForShieldingWithKeystone:
// return .none
//
// case .shieldFundsFailure:
// state.isShieldingFunds = false
// //state.alert = AlertState.shieldFundsFailure(error)
// return .none
//
// case .shieldFundsSuccess:
// state.isShieldingFunds = false
// state.transparentBalance = .zero
// if let account = state.selectedWalletAccount {
// walletStorage.resetShieldingReminder(account.account)
// }
// return .none
case .synchronizerStateChanged(let latestState):
return .send(.updateBalances(latestState.data.accountsBalances))
@ -274,15 +188,3 @@ public struct Balances {
}
}
}
//
//// MARK: Alerts
//
//extension AlertState where Action == Balances.Action {
// public static func shieldFundsFailure(_ error: ZcashError) -> AlertState {
// AlertState {
// TextState(L10n.Balances.Alert.ShieldFunds.Failure.title)
// } message: {
// TextState(L10n.Balances.Alert.ShieldFunds.Failure.message(error.detailedMessage))
// }
// }
//}

View File

@ -1,6 +1,6 @@
//
// BalancesView.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 04.08.2022.
//
@ -86,12 +86,6 @@ public struct BalancesView: View {
}
.screenHorizontalPadding()
.applyScreenBackground()
// .alert(
// store: store.scope(
// state: \.$alert,
// action: \.alert
// )
// )
.onAppear { store.send(.onAppear) }
.onDisappear { store.send(.onDisappear) }
}

View File

@ -1,6 +1,6 @@
//
// DeleteWalletStore.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 03-27-2024
//

View File

@ -1,6 +1,6 @@
//
// DeleteWalletView.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 03-27-2024
//

View File

@ -50,7 +50,6 @@ public struct ExportTransactionHistoryView: View {
}
}
.zashiBack()
//..walletstatusPanel()
shareLogsView()
}

View File

@ -9,13 +9,11 @@ import Generated
import ReviewRequest
import TransactionList
import Scan
import SyncProgress
import WalletBalances
import PartnerKeys
import UserPreferencesStorage
import Utils
import SmartBanner
//import ShieldingProcessor
@Reducer
public struct Home {
@ -35,12 +33,8 @@ public struct Home {
public var isRateTooltipEnabled = false
public var migratingDatabase = true
public var moreRequest = false
// public var shieldingProcessorState = ShieldingProcessor.State()
public var smartBannerState = SmartBanner.State.initial
public var syncProgressState: SyncProgress.State
public var walletConfig: WalletConfig
// public var scanBinding = false
// public var scanState = Scan.State.initial
@Shared(.inMemory(.selectedWalletAccount)) public var selectedWalletAccount: WalletAccount? = nil
public var transactionListState: TransactionList.State
public var uAddress: UnifiedAddress? = nil
@ -76,14 +70,12 @@ public struct Home {
public init(
canRequestReview: Bool = false,
migratingDatabase: Bool = true,
syncProgressState: SyncProgress.State,
transactionListState: TransactionList.State,
walletBalancesState: WalletBalances.State,
walletConfig: WalletConfig
) {
self.canRequestReview = canRequestReview
self.migratingDatabase = migratingDatabase
self.syncProgressState = syncProgressState
self.transactionListState = transactionListState
self.walletConfig = walletConfig
self.walletBalancesState = walletBalancesState
@ -111,17 +103,14 @@ public struct Home {
case resolveReviewRequest
case retrySync
case reviewRequestFinished
// case scan(Scan.Action)
case scanTapped
case seeAllTransactionsTapped
case sendTapped
case settingsTapped
// case shieldingProcessor(ShieldingProcessor.Action)
case showSynchronizerErrorAlert(ZcashError)
case smartBanner(SmartBanner.Action)
case synchronizerStateChanged(RedactableSynchronizerState)
case syncFailed(ZcashError)
case syncProgress(SyncProgress.Action)
case updateTransactionList([TransactionState])
case transactionList(TransactionList.Action)
case walletAccountTapped(WalletAccount)
@ -147,18 +136,6 @@ public struct Home {
TransactionList()
}
// Scope(state: \.shieldingProcessorState, action: \.shieldingProcessor) {
// ShieldingProcessor()
// }
// Scope(state: \.scanState, action: \.scan) {
// Scan()
// }
Scope(state: \.syncProgressState, action: \.syncProgress) {
SyncProgress()
}
Scope(state: \.walletBalancesState, action: \.walletBalances) {
WalletBalances()
}
@ -173,7 +150,6 @@ public struct Home {
return .send(.smartBanner(.debug))
case .onAppear:
// state.scanState.checkers = [.zcashAddressScanChecker, .requestZecScanChecker]
state.appId = PartnerKeys.cbProjectId
state.walletBalancesState.migratingDatabase = state.migratingDatabase
state.migratingDatabase = false
@ -200,7 +176,6 @@ public struct Home {
return .none
case .scanTapped:
// state.scanBinding = true
return .none
case .moreTapped:
@ -244,9 +219,6 @@ public struct Home {
return .none
}
case .syncProgress:
return .none
case .foundTransactions:
return .run { _ in
reviewRequest.foundTransactions()
@ -294,10 +266,6 @@ public struct Home {
state.alert = nil
return .none
// case .scan(.cancelTapped):
// state.scanBinding = false
// return .none
case .alert:
return .none
@ -310,9 +278,6 @@ public struct Home {
case .currencyConversionSetupTapped:
return .none
// case .scan:
// return .none
// Accounts
case .accountSwitchTapped:
@ -338,37 +303,14 @@ public struct Home {
case .walletAccountTapped:
state.accountSwitchRequest = false
return .none
// guard state.selectedWalletAccount != walletAccount else {
// return .none
// }
// state.$selectedWalletAccount.withLock { $0 = walletAccount }
// return .send(.smartBanner(.walletAccountChanged))
//state.homeState.transactionListState.isInvalidated = true
// state.receiveState.currentFocus = .uaAddress
// return .concatenate(
// .send(.home(.walletBalances(.updateBalances))),
// .send(.send(.walletBalances(.updateBalances))),
// .send(.balanceBreakdown(.walletBalances(.updateBalances))),
// .send(.transactionsManager(.resetFiltersTapped))
// )
// return .none
// Smart Banner
case .smartBanner(.currencyConversionScreenRequested):
return .send(.currencyConversionSetupTapped)
case .smartBanner(.shieldFundsTapped):
//return .send(.shieldingProcessor(.shieldFunds))
return .none
// Shielding processor
// case .shieldingProcessor(.shieldFundsFailure(let error)):
// state.alert = AlertState.shieldFundsFailure(error)
// return .none
// More actions
case .coinbaseTapped:
state.moreRequest = false
state.isInAppBrowserCoinbaseOn = true
@ -382,22 +324,7 @@ public struct Home {
case .smartBanner:
return .none
// case .shieldingProcessor:
// return .none
}
}
}
}
// MARK: Alerts
//extension AlertState where Action == Home.Action {
// public static func shieldFundsFailure(_ error: ZcashError) -> AlertState {
// AlertState {
// TextState(L10n.Balances.Alert.ShieldFunds.Failure.title)
// } message: {
// TextState(L10n.Balances.Alert.ShieldFunds.Failure.message(error.detailedMessage))
// }
// }
//}

View File

@ -46,20 +46,6 @@ public struct HomeView: View {
store.send(.debug)
}
// if walletStatus == .restoring {
// SyncProgressView(
// store: store.scope(
// state: \.syncProgressState,
// action: \.syncProgress
// )
// )
// .frame(height: 94)
// .frame(maxWidth: .infinity)
// .background(Asset.Colors.syncProgresBcg.color)
// .padding(.top, 7)
// .padding(.bottom, 20)
// }
HStack(spacing: 8) {
button(
L10n.Tabs.receive,
@ -91,7 +77,6 @@ public struct HomeView: View {
}
.zFont(.medium, size: 12, style: Design.Text.primary)
.padding(.top, 24)
// .padding(.bottom, 32)
.screenHorizontalPadding()
SmartBannerView(
@ -100,55 +85,12 @@ public struct HomeView: View {
action: \.smartBanner
)
)
// SmartBanner(isOpen: true) {
//// EmptyView()
// HStack(spacing: 0) {
// //VStack(alignment: .leading, spacing: 0) {
// Asset.Assets.infoCircle.image
// .zImage(size: 20, style: Design.Utility.Gray._900)
// .padding(.trailing, 12)
// //Spacer()
// //}
//
// VStack(alignment: .leading, spacing: 0) {
// Text("Wallet Backup Required")
// .zFont(.medium, size: 14, style: Design.Utility.Gray._900)
// Text("Prevent potential loss of funds")
// .zFont(.medium, size: 12, style: Design.Utility.Gray._700)
// }
// .lineLimit(1)
//
// Spacer()
//
// ZashiButton("Get started") {
//
// }
// .frame(width: 106)
// .padding(.trailing, 6)
// }
// }
// .padding(.bottom, 40)
// SmartBanner()
// .padding(.bottom, 40)
// SmartBanner {
// Text("content is much bigger content is much bigger content is much bigger content is much bigger content is much bigger content is much bigger content is much bigger content is much bigger content is much bigger content is much bigger content is much bigger ")
// .fixedSize(horizontal: false, vertical: true)
// }
// SmartBanner {
// Text("ch bigger content is much bigger content is much bigger content is much bigger content is much bigger content is much bigger ")
// }
//VStack(spacing: 0) {
ScrollView {
if store.transactionListState.transactions.isEmpty && !store.transactionListState.isInvalidated {
noTransactionsView()
// .padding(.top, store.isSmartWidgetOpen ? 0 : 100)//12)
// .padding(.top, 12)
} else {
VStack(spacing: 0) {
// noTransactionsView()
transactionsView()
TransactionListView(
@ -161,30 +103,9 @@ public struct HomeView: View {
scrollable: false
)
}
// .padding(.top, store.isSmartWidgetOpen ? 0 : 100)//12)
}
}
//.padding(.top, 12)
}
// .popover(
// isPresented:
// Binding(
// get: { store.balancesBinding },
// set: { store.send(.balancesBindingUpdated($0)) }
// )
// ) {
//
// //NavigationView {
//// BalancesView(
//// store:
//// store.scope(
//// state: \.balancesState,
//// action: \.balances
//// ),
//// tokenName: tokenName
//// )
// //}
// }
.sheet(isPresented: $store.isInAppBrowserCoinbaseOn) {
if let urlStr = store.inAppBrowserURLCoinbase, let url = URL(string: urlStr) {
InAppBrowserView(url: url)
@ -231,89 +152,10 @@ public struct HomeView: View {
}
}
}
// .overlayPreferenceValue(ExchangeRateFeaturePreferenceKey.self) { preferences in
// WithPerceptionTracking {
// if store.isRateEducationEnabled {
// GeometryReader { geometry in
// preferences.map {
// VStack(alignment: .leading, spacing: 0) {
// HStack(alignment: .top, spacing: 0) {
// Asset.Assets.Icons.coinsSwap.image
// .zImage(size: 20, style: Design.Text.primary)
// .padding(10)
// .background {
// Circle()
// .fill(Design.Surfaces.bgTertiary.color(colorScheme))
// }
// .padding(.trailing, 16)
//
// VStack(alignment: .leading, spacing: 5) {
// Text(L10n.CurrencyConversion.cardTitle)
// .zFont(size: 14, style: Design.Text.tertiary)
//
// Text(L10n.CurrencyConversion.title)
// .zFont(.semiBold, size: 16, style: Design.Text.primary)
// .lineLimit(1)
// .minimumScaleFactor(0.5)
// }
// .padding(.trailing, 16)
//
// Spacer(minLength: 0)
//
// Button {
// store.send(.currencyConversionCloseTapped)
// } label: {
// Asset.Assets.buttonCloseX.image
// .zImage(size: 20, style: Design.HintTooltips.defaultFg)
// }
// .padding(20)
// .offset(x: 20, y: -20)
// }
//
// Button {
// store.send(.currencyConversionSetupTapped)
// } label: {
// Text(L10n.CurrencyConversion.cardButton)
// .zFont(.semiBold, size: 16, style: Design.Btns.Tertiary.fg)
// .frame(height: 24)
// .frame(maxWidth: .infinity)
// .padding(.vertical, 12)
// .background {
// RoundedRectangle(cornerRadius: Design.Radius._xl)
// .fill(Design.Btns.Tertiary.bg.color(colorScheme))
// }
// }
// }
// .padding(24)
// .background {
// RoundedRectangle(cornerRadius: Design.Radius._xl)
// .fill(Design.Surfaces.bgPrimary.color(colorScheme))
// .background {
// RoundedRectangle(cornerRadius: Design.Radius._xl)
// .stroke(Design.Surfaces.strokeSecondary.color(colorScheme))
// }
// }
// .frame(width: geometry.size.width - 40)
// .offset(x: 20, y: geometry[$0].minY + geometry[$0].height)
// }
// }
// }
// }
// }
//..walletstatusPanel()
.applyScreenBackground()
.onAppear {
store.send(.onAppear)
}
// .popover(isPresented: $store.scanBinding) {
// ScanView(
// store:
// store.scope(
// state: \.scanState,
// action: \.scan
// )
// )
// }
.onChange(of: store.canRequestReview) { canRequestReview in
if canRequestReview {
if let currentScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
@ -502,11 +344,6 @@ struct HomeView_Previews: PreviewProvider {
StoreOf<Home>(
initialState:
.init(
syncProgressState: .init(
lastKnownSyncPercentage: Float(0.43),
synchronizerStatusSnapshot: SyncStatusSnapshot(.syncing(0.41, false)),
syncStatusMessage: "Syncing"
),
transactionListState: .initial,
walletBalancesState: .initial,
walletConfig: .initial
@ -530,7 +367,6 @@ struct HomeView_Previews: PreviewProvider {
extension Home.State {
public static var initial: Self {
.init(
syncProgressState: .initial,
transactionListState: .initial,
walletBalancesState: .initial,
walletConfig: .initial
@ -550,7 +386,6 @@ extension Home {
public static var error: StoreOf<Home> {
StoreOf<Home>(
initialState: .init(
syncProgressState: .initial,
transactionListState: .initial,
walletBalancesState: .initial,
walletConfig: .initial

View File

@ -34,7 +34,7 @@ extension HomeView {
Spacer()
}
Text("More Options")
Text(L10n.Home.moreOptions)
.zFont(.semiBold, size: 20, style: Design.Text.primary)
.padding(.top, 32)
.padding(.bottom, 24)

View File

@ -1,6 +1,6 @@
//
// NotEnoughFreeSpaceView.swift
// secant-testnet
// Zashi
//
// Created by Michal Fousek on 28.09.2022.
//
@ -67,10 +67,10 @@ public struct NotEnoughFreeSpaceView: View {
}
func settingsButton() -> some View {
return Image(systemName: "line.3.horizontal")
.resizable()
.frame(width: 21, height: 15)
.padding(15)
Asset.Assets.Icons.settings.image
.zImage(size: 24, style: Design.Text.primary)
.padding(8)
.tint(Asset.Colors.primary.color)
.navigationLink(
isActive: $store.isSettingsOpen,
destination: {
@ -83,7 +83,6 @@ public struct NotEnoughFreeSpaceView: View {
)
}
)
.tint(Asset.Colors.primary.color)
}
}

View File

@ -1,6 +1,6 @@
//
// OSStatusErrorView.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 2024-11-20.
//

View File

@ -105,13 +105,7 @@ public struct OnboardingFlow {
state.restoreWalletCoordFlowState = .initial
state.destination = .importExistingWallet
return .none
// case .importWallet:
// return .none
// case .securityWarning:
// return .none
case .restoreWalletCoordFlow:
return .none
}

View File

@ -1,6 +1,6 @@
//
// PrivateDataConsentStore.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 01.11.2023.
//

View File

@ -1,6 +1,6 @@
//
// PrivateDataConsentView.swift
// secant-testnet
// Zashi
//
// Created by Lukáš Korba on 01.10.2023.
//
@ -97,7 +97,6 @@ public struct PrivateDataConsentView: View {
.padding(.vertical, 1)
.zashiBack()
.onAppear { store.send(.onAppear)}
//..walletstatusPanel()
shareLogsView()
}

Some files were not shown because too many files have changed in this diff Show More