Skip to content

Commit

Permalink
Bugfix FXIOS-10434 ⁃ [Menu] [Accessibility] - Account name is incorre…
Browse files Browse the repository at this point in the history
…ctly announced with voice over (#22878)

FXIOS-10434 #22840 ⁃ [Menu] [Accessibility] - Account name is incorrectly announced with voice over
  • Loading branch information
dicarobinho authored Nov 5, 2024
1 parent 4e0185e commit 76ee3e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ final class MainMenuMiddleware {
icon: image)
}
} else {
self.dispatchUpdateAccountHeader(
accountData: accountData,
action: action,
icon: nil)
self.dispatchUpdateAccountHeader(accountData: accountData, action: action)
}
} else {
self.dispatchUpdateAccountHeader(action: action)
}
store.dispatch(
MainMenuAction(
Expand All @@ -49,9 +48,9 @@ final class MainMenuMiddleware {
}
}

private func dispatchUpdateAccountHeader(accountData: AccountData?,
private func dispatchUpdateAccountHeader(accountData: AccountData? = nil,
action: MainMenuAction,
icon: UIImage?) {
icon: UIImage? = nil) {
store.dispatch(
MainMenuAction(
windowUUID: action.windowUUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,14 @@ struct MainMenuState: ScreenState, Equatable {
accountIcon: state.accountIcon
)
case MainMenuMiddlewareActionType.updateAccountHeader:
guard let action = action as? MainMenuAction,
let accountData = action.accountData
guard let action = action as? MainMenuAction
else { return state }

return MainMenuState(
windowUUID: state.windowUUID,
menuElements: state.menuElements,
currentTabInfo: state.currentTabInfo,
accountData: accountData,
accountData: action.accountData,
accountIcon: action.accountIcon
)
case MainMenuActionType.updateCurrentTabInfo:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ class MainMenuViewController: UIViewController,

if let accountData = menuState.accountData {
updateHeaderWith(accountData: accountData, icon: menuState.accountIcon)
setupAccessibilityIdentifiers(mainButtonA11yLabel: accountData.title)
}

if menuState.currentSubmenuView != nil {
Expand Down Expand Up @@ -335,11 +336,12 @@ class MainMenuViewController: UIViewController,
return sheetController.selectedDetentIdentifier
}

private func setupAccessibilityIdentifiers() {
private func setupAccessibilityIdentifiers(
mainButtonA11yLabel: String = .MainMenu.Account.AccessibilityLabels.MainButton) {
menuContent.setupAccessibilityIdentifiers(
closeButtonA11yLabel: .MainMenu.Account.AccessibilityLabels.CloseButton,
closeButtonA11yId: AccessibilityIdentifiers.MainMenu.HeaderView.closeButton,
mainButtonA11yLabel: .MainMenu.Account.AccessibilityLabels.MainButton,
mainButtonA11yLabel: mainButtonA11yLabel,
mainButtonA11yId: AccessibilityIdentifiers.MainMenu.HeaderView.mainButton,
menuA11yId: AccessibilityIdentifiers.MainMenu.mainMenu,
menuA11yLabel: .MainMenu.TabsSection.AccessibilityLabels.MainMenu)
Expand Down

0 comments on commit 76ee3e5

Please sign in to comment.