-
Notifications
You must be signed in to change notification settings - Fork 9
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-1872 Transition to new persona data format/rewire persona from dapp details #611
ABW-1872 Transition to new persona data format/rewire persona from dapp details #611
Conversation
fatalError() | ||
guard case let .dApp(dApp, persona) = mode else { return nil } | ||
return .init( | ||
name: dApp.displayName?.rawValue ?? L10n.DAppRequest.Metadata.unknownName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general I think default values like "unknown" should be added as late as possible, ideally in the viewstate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, this IS the viewstate, then that's all good.
@@ -127,8 +127,8 @@ public struct PersonasCoordinator: Sendable, FeatureReducer { | |||
return .task { | |||
let dApps = try await authorizedDappsClient.getDappsAuthorizedByPersona(persona.id) | |||
.map(PersonaDetails.State.DappInfo.init) | |||
let personaDetails = PersonaDetails.State(.general(persona, dApps: .init(uniqueElements: dApps))) | |||
return .internal(.loadedPersonaDetails(personaDetails)) | |||
let personaDetailsState = PersonaDetails.State(.general(persona, dApps: .init(uniqueElements: dApps))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't typically add "state" at the end of variables. Note also that the name of the case is loadedPersonaDetails
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to make the variable names longer though.
@maciek-rdx We should NOT use "personaDetailsState", it should be "personaDetails". |
Jira ticket: ABW-1872
Description
Fixes the crash that you can experience when opening Persona details from dApp Details screen.
How to test
Happy path (or test variation 1)
The app should not crash and display the right data.
Screenshot
PR submission checklist