-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add FXIOS-9627-[Native Error Page] Initial changes for manager support #22613
base: main
Are you sure you want to change the base?
Conversation
103279c
to
e213824
Compare
2cacdf5
to
f7d4652
Compare
configureUI() | ||
setupLayout() | ||
adjustConstraints() | ||
showViewForCurrentOrientation() | ||
} | ||
|
||
// MARK: Redux | ||
func newState(state: NativeErrorPageState) { | ||
// if state.title != nil { |
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.
?? what dis?
@@ -89,37 +89,67 @@ final class NativeErrorPageViewController: UIViewController, | |||
|
|||
private var contraintsList = [NSLayoutConstraint]() | |||
|
|||
required init?( |
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.
How come we're removing this?
} | ||
|
||
static let reducer: Reducer<Self> = { state, action in | ||
print(action.actionType) |
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 shouldn't have these statements in production
|
||
static let reducer: Reducer<Self> = { state, action in | ||
print(action.actionType) | ||
guard action.windowUUID == .unavailable || action.windowUUID == state.windowUUID else { return NativeErrorPageState( |
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.
nit: return can be on a separate line here
title: state.title, | ||
description: state.description | ||
)} | ||
switch action.actionType { |
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.
nit: leave some space so it's easier to read. Vertical space is free, we may as well take advantage!
)} | ||
switch action.actionType { | ||
case NativeErrorPageMiddlewareActionType.initialize: | ||
guard let action = action as? NativeErrorPageAction, let model = action.nativePageErrorModel else { |
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.
nit: spread the multiple let conditions over multiple lines for easy reading
let newAction = NativeErrorPageAction(nativePageErrorModel: model, | ||
windowUUID: windowUUID, | ||
actionType: NativeErrorPageMiddlewareActionType.initialize | ||
) | ||
store.dispatch(newAction) |
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.
let newAction = NativeErrorPageAction(nativePageErrorModel: model, | |
windowUUID: windowUUID, | |
actionType: NativeErrorPageMiddlewareActionType.initialize | |
) | |
store.dispatch(newAction) | |
store.dispatch( | |
NativeErrorPageAction(nativePageErrorModel: model, | |
windowUUID: windowUUID, | |
actionType: NativeErrorPageMiddlewareActionType.initialize | |
) | |
) |
nit: alternative to consider that doesn't require assignment.
final class NativeErrorPageMiddleware { | ||
lazy var nativeErrorPageProvider: Middleware<AppState> = { state, action in | ||
let windowUUID = action.windowUUID | ||
print(action.actionType) |
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.
no need for print
statements in prod
lazy var nativeErrorPageProvider: Middleware<AppState> = { state, action in | ||
let windowUUID = action.windowUUID | ||
print(action.actionType) | ||
switch action.actionType { |
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.
spppaaaaaaccccceeeee :P
func parseErrorDetails() -> ErrorPageModel { | ||
var title = "" | ||
var description = "" | ||
switch error.code { |
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.
Space for readibility
📜 Tickets
Jira ticket
Github issue
💡 Description
📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)