- The SDK updated to the latest main (commit hash) - Fixes for a few texts - UX improvement: Upgrading databases... label for cases when it takes a few seconds, most of the times it is so quick that the label is even not visible to the user. It simple dismisses before user lands on a home page from the welcome screen - fixed tests after adding the flag for migration
This commit is contained in:
parent
ae2c18006d
commit
0206641fc6
|
@ -60,7 +60,7 @@ let package = Package(
|
|||
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "0.14.1"),
|
||||
.package(url: "https://github.com/pointfreeco/swift-url-routing", from: "0.5.0"),
|
||||
.package(url: "https://github.com/SwiftGen/SwiftGenPlugin", from: "6.6.0"),
|
||||
.package(url: "https://github.com/zcash/ZcashLightClientKit", revision: "ee3d082155bf542aa3580c84e6140a329633319a"),
|
||||
.package(url: "https://github.com/zcash/ZcashLightClientKit", revision: "e4cea0c265e803ad2820d358c1daa565c3107497"),
|
||||
.package(url: "https://github.com/zcash-hackworks/MnemonicSwift", from: "2.2.4")
|
||||
],
|
||||
targets: [
|
||||
|
|
|
@ -46,6 +46,7 @@ public struct HomeReducer: ReducerProtocol {
|
|||
public var synchronizerStatusSnapshot: SyncStatusSnapshot
|
||||
public var walletConfig: WalletConfig
|
||||
public var walletEventsState: WalletEventsFlowReducer.State
|
||||
public var migratingDatabase = true
|
||||
// TODO: [#311] - Get the ZEC price from the SDK, https://github.com/zcash/secant-ios-wallet/issues/311
|
||||
public var zecPrice = Decimal(140.0)
|
||||
|
||||
|
@ -196,10 +197,14 @@ public struct HomeReducer: ReducerProtocol {
|
|||
case .synchronizerStateChanged(let latestState):
|
||||
let snapshot = SyncStatusSnapshot.snapshotFor(state: latestState.syncStatus)
|
||||
|
||||
guard snapshot != state.synchronizerStatusSnapshot else {
|
||||
guard snapshot.syncStatus != state.synchronizerStatusSnapshot.syncStatus else {
|
||||
return .none
|
||||
}
|
||||
|
||||
if snapshot.syncStatus != .unprepared {
|
||||
state.migratingDatabase = false
|
||||
}
|
||||
|
||||
state.synchronizerStatusSnapshot = snapshot
|
||||
state.shieldedBalance = latestState.shieldedBalance.redacted
|
||||
|
||||
|
|
|
@ -141,10 +141,14 @@ extension HomeView {
|
|||
.font(.system(size: 20))
|
||||
}
|
||||
|
||||
Text(viewStore.synchronizerStatusSnapshot.message)
|
||||
.accessDebugMenuWithHiddenGesture {
|
||||
viewStore.send(.debugMenuStartup)
|
||||
}
|
||||
if viewStore.migratingDatabase {
|
||||
Text(L10n.Home.migratingDatabases)
|
||||
} else {
|
||||
Text(viewStore.synchronizerStatusSnapshot.message)
|
||||
.accessDebugMenuWithHiddenGesture {
|
||||
viewStore.send(.debugMenuStartup)
|
||||
}
|
||||
}
|
||||
}
|
||||
.foregroundColor(Asset.Colors.Mfp.primary.color)
|
||||
}
|
||||
|
|
|
@ -147,6 +147,8 @@ public enum L10n {
|
|||
public static let yes = L10n.tr("Localizable", "general.yes", fallback: "Yes")
|
||||
}
|
||||
public enum Home {
|
||||
/// Upgrading databases…
|
||||
public static let migratingDatabases = L10n.tr("Localizable", "home.migratingDatabases", fallback: "Upgrading databases…")
|
||||
/// Receive %@
|
||||
public static func receiveZec(_ p1: Any) -> String {
|
||||
return L10n.tr("Localizable", "home.receiveZec", String(describing: p1), fallback: "Receive %@")
|
||||
|
@ -485,12 +487,12 @@ public enum L10n {
|
|||
/// Send Zcash
|
||||
public static let title = L10n.tr("Localizable", "send.title", fallback: "Send Zcash")
|
||||
public enum Error {
|
||||
/// insufficient funds
|
||||
public static let insufficientFunds = L10n.tr("Localizable", "send.error.insufficientFunds", fallback: "insufficient funds")
|
||||
/// invalid address
|
||||
public static let invalidAddress = L10n.tr("Localizable", "send.error.invalidAddress", fallback: "invalid address")
|
||||
/// invalid amount
|
||||
public static let invalidAmount = L10n.tr("Localizable", "send.error.invalidAmount", fallback: "invalid amount")
|
||||
/// Insufficient funds
|
||||
public static let insufficientFunds = L10n.tr("Localizable", "send.error.insufficientFunds", fallback: "Insufficient funds")
|
||||
/// Invalid address
|
||||
public static let invalidAddress = L10n.tr("Localizable", "send.error.invalidAddress", fallback: "Invalid address")
|
||||
/// Invalid amount
|
||||
public static let invalidAmount = L10n.tr("Localizable", "send.error.invalidAmount", fallback: "Invalid amount")
|
||||
}
|
||||
}
|
||||
public enum Settings {
|
||||
|
|
|
@ -75,6 +75,8 @@
|
|||
"home.syncFailed.title" = "Sync failed!";
|
||||
"home.syncFailed.dismiss" = "Dismiss";
|
||||
"home.syncFailed.retry" = "Retry";
|
||||
"home.migratingDatabases" = "Upgrading databases…";
|
||||
|
||||
// MARK: - Receive ZEC (Formerly Profile Screen)
|
||||
"receiveZec.yourAddress" = "Your Address";
|
||||
"receiveZec.error.cantExtractUnifiedAddress" = "could not extract UA";
|
||||
|
|
|
@ -230,7 +230,7 @@
|
|||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/zcash-hackworks/zcash-light-client-ffi",
|
||||
"state" : {
|
||||
"revision" : "cdbc06f10b2d7cbe0d6362b30f68167825942e86"
|
||||
"revision" : "7718b764027c2a4b9f654ed0b712b87ce881348f"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -238,7 +238,7 @@
|
|||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/zcash/ZcashLightClientKit",
|
||||
"state" : {
|
||||
"revision" : "ee3d082155bf542aa3580c84e6140a329633319a"
|
||||
"revision" : "e4cea0c265e803ad2820d358c1daa565c3107497"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
@ -59,9 +59,7 @@ class HomeTests: XCTestCase {
|
|||
|
||||
// expected side effects as a result of .onAppear registration
|
||||
store.receive(.updateDestination(nil))
|
||||
store.receive(.synchronizerStateChanged(.zero)) { state in
|
||||
state.synchronizerStatusSnapshot = SyncStatusSnapshot.snapshotFor(state: .unprepared)
|
||||
}
|
||||
store.receive(.synchronizerStateChanged(.zero))
|
||||
|
||||
// long-living (cancelable) effects need to be properly canceled.
|
||||
// the .onDisappear action cancels the observer of the synchronizer status change.
|
||||
|
@ -107,6 +105,7 @@ class HomeTests: XCTestCase {
|
|||
|
||||
store.send(.synchronizerStateChanged(state)) { state in
|
||||
state.synchronizerStatusSnapshot = errorSnapshot
|
||||
state.migratingDatabase = false
|
||||
}
|
||||
|
||||
store.receive(.showSynchronizerErrorAlert(testError)) { state in
|
||||
|
|
|
@ -47,6 +47,7 @@ final class ReviewRequestTests: XCTestCase {
|
|||
|
||||
await store.send(.synchronizerStateChanged(syncState)) { state in
|
||||
state.synchronizerStatusSnapshot = snapshot
|
||||
state.migratingDatabase = false
|
||||
}
|
||||
|
||||
let storedDate = userDefaultsClient.objectForKey(ReviewRequestClient.Constants.latestSyncKey) as? TimeInterval
|
||||
|
|
Loading…
Reference in New Issue