Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABW-1839 App spills some runtime warnings after the creation of an account on simulator #596

Merged
merged 18 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public struct CreationOfAccount: Sendable, FeatureReducer {
}
}

public enum ViewAction: Sendable, Equatable {
case onFirstTask
}

public enum InternalAction: Sendable, Equatable {
case createAccountResult(TaskResult<Profile.Network.Account>)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ extension CreationOfAccount {
.navigationBarTitleDisplayMode(.inline)
.navigationBarInlineTitleFont(.app.secondaryHeader)
#endif
#if targetEnvironment(simulator)
.onFirstTask {
ViewStore(store.stateless).send(.view(.onFirstTask))
}
#else
.onFirstTask { @MainActor in
await ViewStore(store.stateless).send(.view(.onFirstTask)).finish()
}
#endif
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ extension NewAccountCompletion {
}
}

@MainActor
public struct View: SwiftUI.View {
private let store: StoreOf<NewAccountCompletion>

Expand Down Expand Up @@ -88,7 +87,6 @@ extension NewAccountCompletion {
}

private extension NewAccountCompletion.View {
@MainActor
@ViewBuilder
func accountsStackView(
with viewStore: ViewStoreOf<NewAccountCompletion>
Expand Down Expand Up @@ -120,12 +118,10 @@ private extension NewAccountCompletion.View {
}
}

@MainActor
func scale(index: Int) -> CGFloat {
1 - (CGFloat(index + 1) * 0.05)
}

@MainActor
func reversedZIndex(count: Int, index: Int) -> Double {
Double(count - index)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ extension DerivePublicKeys {
public let ledger: LedgerHardwareWalletFactorSource?
}

@MainActor
public struct View: SwiftUI.View {
private let store: StoreOf<DerivePublicKeys>

Expand Down Expand Up @@ -47,6 +46,9 @@ extension DerivePublicKeys {
}
.padding(.horizontal, .medium1)
.onFirstTask { @MainActor in
/// For more information about that `sleep` please check [this discussion in Slack](https://rdxworks.slack.com/archives/C03QFAWBRNX/p1687967412207119?thread_ts=1687964494.772899&cid=C03QFAWBRNX)
try? await Task.sleep(for: .seconds(0.7))

await viewStore.send(.onFirstTask).finish()
}
}
Expand Down