diff --git a/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings b/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings index 35aa508bb..48a170c3e 100644 --- a/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings @@ -177,6 +177,8 @@ "call_invalid_audio_device_bluetooth_devices_disabled" = "Element Call does not support using Bluetooth audio devices in this Android version. Please select a different audio device."; "common_about" = "About"; "common_acceptable_use_policy" = "Acceptable use policy"; +"common_add_account" = "Add an account"; +"common_add_another_account" = "Add another account"; "common_adding_caption" = "Adding caption"; "common_advanced_settings" = "Advanced settings"; "common_an_image" = "an image"; @@ -250,6 +252,7 @@ "common_name_and_id" = "%1$@ (%2$@)"; "common_no_results" = "No results"; "common_no_room_name" = "No room name"; +"common_no_space_name" = "No space name"; "common_not_encrypted" = "Not encrypted"; "common_offline" = "Offline"; "common_open_source_licenses" = "Open source licenses"; @@ -268,8 +271,10 @@ "common_poll_undisclosed_text" = "Results will show after the poll has ended"; "common_preparing" = "Preparing…"; "common_privacy_policy" = "Privacy policy"; +"common_private" = "Private"; "common_private_room" = "Private room"; "common_private_space" = "Private space"; +"common_public" = "Public"; "common_public_room" = "Public room"; "common_public_space" = "Public space"; "common_reaction" = "Reaction"; @@ -294,6 +299,7 @@ "common_search_results" = "Search results"; "common_security" = "Security"; "common_seen_by" = "Seen by"; +"common_select_account" = "Select an account"; "common_send_to" = "Send to"; "common_sending" = "Sending…"; "common_sending_failed" = "Sending failed"; @@ -311,6 +317,7 @@ "common_something_went_wrong" = "Something went wrong"; "common_something_went_wrong_message" = "We encountered an issue. Please try again."; "common_space" = "Space"; +"common_space_members" = "Space members"; "common_space_topic_placeholder" = "What is this space about?"; "common_starting_chat" = "Starting chat…"; "common_sticker" = "Sticker"; @@ -353,10 +360,6 @@ "common_waiting_for_decryption_key" = "Waiting for this message"; "common_world_readable_history" = "Anyone can see history"; "common_you" = "You"; -"common.add_account" = "Add an account"; -"common.add_another_account" = "Add another account"; -"common.no_space_name" = "No space name"; -"common.select_account" = "Select an account"; "common_unable_to_decrypt_insecure_device" = "Sent from an insecure device"; "common_unable_to_decrypt_verification_violation" = "Sender's verified identity was reset"; "confirm_recovery_key_banner_message" = "Confirm your recovery key to maintain access to your key storage and message history."; @@ -373,6 +376,9 @@ "crypto_event_authenticity_unverified_identity" = "Encrypted by an unverified user."; "crypto_event_key_forwarded_known_profile_dialog_content" = "%1$@ (%2$@) shared this message since you were not in the room when it was sent."; "crypto_event_key_forwarded_unknown_profile_dialog_content" = "%1$@ shared this message since you were not in the room when it was sent."; +"crypto_history_sharing_room_info_hidden_badge_content" = "New members don't see history"; +"crypto_history_sharing_room_info_shared_badge_content" = "New members see history"; +"crypto_history_sharing_room_info_world_readable_badge_content" = "Anyone can see history"; "crypto_history_visible" = "This room has been configured so that new members can read history. %1$@"; "crypto_identity_change_pin_violation" = "%1$@'s identity was reset. %2$@"; "crypto_identity_change_pin_violation_new" = "%1$@’s %2$@ identity was reset. %3$@"; @@ -549,9 +555,7 @@ "screen_create_room_room_access_section_knocking_restricted_option_description" = "Anyone in %1$@ can join but everyone else must request access."; "screen_create_room_room_access_section_knocking_restricted_option_title" = "Ask to join"; "screen_create_room_room_access_section_private_option_description" = "Only people invited can join."; -"screen_create_room_room_access_section_private_option_title" = "Private"; "screen_create_room_room_access_section_public_option_description" = "Anyone can join."; -"screen_create_room_room_access_section_public_option_title" = "Public"; "screen_create_room_room_access_section_restricted_option_description" = "Anyone in %1$@ can join."; "screen_create_room_room_access_section_restricted_option_title" = "Standard"; "screen_create_room_room_access_section_title" = "Who has access"; @@ -559,7 +563,8 @@ "screen_create_room_room_address_section_title" = "Address"; "screen_create_room_room_visibility_section_title" = "Room visibility"; "screen_create_room_space_selection_no_space_description" = "(no space)"; -"screen_create_room_space_selection_no_space_title" = "Home"; +"screen_create_room_space_selection_no_space_option" = "Do not add to a space"; +"screen_create_room_space_selection_no_space_title" = "No space selected"; "screen_create_room_space_selection_sheet_title" = "Add to space"; "screen_create_room_topic_placeholder" = "Add description…"; "screen_decline_and_block_block_user_option_description" = "You will not see any messages or room invites from this user"; @@ -611,7 +616,6 @@ "screen_labs_header_description" = "Try out our latest ideas in development. These features are not finalized; they may be unstable, may change."; "screen_labs_header_title" = "Feeling experimental?"; "screen_labs_title" = "Labs"; -"screen_leave_space_choose_owners_action" = "Choose owners"; "screen_leave_space_last_admin_info" = "%1$@ (Admin)"; "screen_leave_space_subtitle" = "Select the rooms you’d like to leave which you're not the only administrator for:"; "screen_leave_space_subtitle_last_admin" = "You need to assign another admin for this space before you can leave."; @@ -718,7 +722,6 @@ "screen_security_and_privacy_room_access_section_header" = "Access"; "screen_security_and_privacy_room_access_space_members_option_multiple_parents_description" = "Anyone in authorized spaces can join."; "screen_security_and_privacy_room_access_space_members_option_single_parent_description" = "Anyone in %1$@ can join."; -"screen_security_and_privacy_room_access_space_members_option_title" = "Space members"; "screen_security_and_privacy_room_access_space_members_option_unavailable_description" = "Spaces are not currently supported"; "screen_security_and_privacy_room_address_section_header" = "Address"; "screen_security_and_privacy_room_directory_visibility_section_footer" = "Allow for this room to be found by searching %1$@ public room directory"; @@ -875,9 +878,7 @@ "screen_create_room_action_create_room" = "New room"; "screen_create_room_error_creating_room" = "An error occurred when creating the room"; "screen_create_room_private_option_description" = "Only people invited can join."; -"screen_create_room_private_option_title" = "Private"; "screen_create_room_public_option_description" = "Anyone can find this room.\nYou can change this anytime in room settings."; -"screen_create_room_public_option_title" = "Public"; "screen_create_room_topic_label" = "Topic (optional)"; "screen_deactivate_account_confirmation_dialog_content" = "Please confirm that you want to deactivate your account. This action cannot be undone."; "screen_deactivate_account_delete_all_messages" = "Delete all my messages"; @@ -1424,6 +1425,8 @@ "screen_bottom_sheet_manage_room_member_kick_member_confirmation_description" = "They will be able to join this room again if invited."; "screen_bottom_sheet_manage_room_member_unban_member_confirmation_action" = "Unban"; "screen_bottom_sheet_manage_room_member_unbanning_user" = "Unbanning %1$@"; +"screen_create_room_room_access_section_private_option_title" = "Private"; +"screen_create_room_room_access_section_public_option_title" = "Public"; "screen_decline_and_block_block_user_option_title" = "Block user"; "screen_decline_and_block_report_user_reason_placeholder" = "Describe the reason to report…"; "screen_decline_and_block_title" = "Decline and block"; @@ -1431,6 +1434,7 @@ "screen_home_tab_spaces" = "Spaces"; "screen_join_room_decline_and_block_button_title" = "Decline and block"; "screen_knock_requests_list_title" = "Requests to join"; +"screen_leave_space_choose_owners_action" = "Choose owners"; "screen_link_new_device_desktop_scanning_title" = "Scan the QR code"; "screen_link_new_device_desktop_step3" = "Scan the QR code with this device"; "screen_link_new_device_desktop_submit" = "Ready to scan"; @@ -1455,6 +1459,7 @@ "screen_roomlist_knock_event_sent_description" = "Request to join sent"; "screen_security_and_privacy_encryption_section_header" = "Encryption"; "screen_security_and_privacy_room_access_footer_manage_spaces_action" = "Manage spaces"; +"screen_security_and_privacy_room_access_space_members_option_title" = "Space members"; "screen_security_and_privacy_room_address_section_footer" = "You’ll need an address in order to make it visible in the public directory."; "screen_space_settings_leave_space" = "Leave space"; "screen_space_settings_roles_and_permissions" = "Roles & permissions"; @@ -1474,6 +1479,8 @@ "screen_create_account_title" = "Create account"; "screen_create_poll_cancel_confirmation_content_ios" = "Your changes won’t be saved"; "screen_create_room_add_people_title" = "Invite people"; +"screen_create_room_private_option_title" = "Private"; +"screen_create_room_public_option_title" = "Public"; "screen_deactivate_account_title" = "Deactivate account"; "screen_dm_details_block_alert_action" = "Block"; "screen_dm_details_block_alert_description" = "Blocked users won't be able to send you messages and all their messages will be hidden. You can unblock them anytime."; diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 2f01b019b..bbc31f415 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -177,6 +177,8 @@ "call_invalid_audio_device_bluetooth_devices_disabled" = "Element Call does not support using Bluetooth audio devices in this Android version. Please select a different audio device."; "common_about" = "About"; "common_acceptable_use_policy" = "Acceptable use policy"; +"common_add_account" = "Add an account"; +"common_add_another_account" = "Add another account"; "common_adding_caption" = "Adding caption"; "common_advanced_settings" = "Advanced settings"; "common_an_image" = "an image"; @@ -250,6 +252,7 @@ "common_name_and_id" = "%1$@ (%2$@)"; "common_no_results" = "No results"; "common_no_room_name" = "No room name"; +"common_no_space_name" = "No space name"; "common_not_encrypted" = "Not encrypted"; "common_offline" = "Offline"; "common_open_source_licenses" = "Open source licenses"; @@ -268,8 +271,10 @@ "common_poll_undisclosed_text" = "Results will show after the poll has ended"; "common_preparing" = "Preparing…"; "common_privacy_policy" = "Privacy policy"; +"common_private" = "Private"; "common_private_room" = "Private room"; "common_private_space" = "Private space"; +"common_public" = "Public"; "common_public_room" = "Public room"; "common_public_space" = "Public space"; "common_reaction" = "Reaction"; @@ -294,6 +299,7 @@ "common_search_results" = "Search results"; "common_security" = "Security"; "common_seen_by" = "Seen by"; +"common_select_account" = "Select an account"; "common_send_to" = "Send to"; "common_sending" = "Sending…"; "common_sending_failed" = "Sending failed"; @@ -311,6 +317,7 @@ "common_something_went_wrong" = "Something went wrong"; "common_something_went_wrong_message" = "We encountered an issue. Please try again."; "common_space" = "Space"; +"common_space_members" = "Space members"; "common_space_topic_placeholder" = "What is this space about?"; "common_starting_chat" = "Starting chat…"; "common_sticker" = "Sticker"; @@ -353,10 +360,6 @@ "common_waiting_for_decryption_key" = "Waiting for this message"; "common_world_readable_history" = "Anyone can see history"; "common_you" = "You"; -"common.add_account" = "Add an account"; -"common.add_another_account" = "Add another account"; -"common.no_space_name" = "No space name"; -"common.select_account" = "Select an account"; "common_unable_to_decrypt_insecure_device" = "Sent from an insecure device"; "common_unable_to_decrypt_verification_violation" = "Sender's verified identity was reset"; "confirm_recovery_key_banner_message" = "Confirm your recovery key to maintain access to your key storage and message history."; @@ -373,6 +376,9 @@ "crypto_event_authenticity_unverified_identity" = "Encrypted by an unverified user."; "crypto_event_key_forwarded_known_profile_dialog_content" = "%1$@ (%2$@) shared this message since you were not in the room when it was sent."; "crypto_event_key_forwarded_unknown_profile_dialog_content" = "%1$@ shared this message since you were not in the room when it was sent."; +"crypto_history_sharing_room_info_hidden_badge_content" = "New members don't see history"; +"crypto_history_sharing_room_info_shared_badge_content" = "New members see history"; +"crypto_history_sharing_room_info_world_readable_badge_content" = "Anyone can see history"; "crypto_history_visible" = "This room has been configured so that new members can read history. %1$@"; "crypto_identity_change_pin_violation" = "%1$@'s identity was reset. %2$@"; "crypto_identity_change_pin_violation_new" = "%1$@’s %2$@ identity was reset. %3$@"; @@ -549,9 +555,7 @@ "screen_create_room_room_access_section_knocking_restricted_option_description" = "Anyone in %1$@ can join but everyone else must request access."; "screen_create_room_room_access_section_knocking_restricted_option_title" = "Ask to join"; "screen_create_room_room_access_section_private_option_description" = "Only people invited can join."; -"screen_create_room_room_access_section_private_option_title" = "Private"; "screen_create_room_room_access_section_public_option_description" = "Anyone can join."; -"screen_create_room_room_access_section_public_option_title" = "Public"; "screen_create_room_room_access_section_restricted_option_description" = "Anyone in %1$@ can join."; "screen_create_room_room_access_section_restricted_option_title" = "Standard"; "screen_create_room_room_access_section_title" = "Who has access"; @@ -559,7 +563,8 @@ "screen_create_room_room_address_section_title" = "Address"; "screen_create_room_room_visibility_section_title" = "Room visibility"; "screen_create_room_space_selection_no_space_description" = "(no space)"; -"screen_create_room_space_selection_no_space_title" = "Home"; +"screen_create_room_space_selection_no_space_option" = "Do not add to a space"; +"screen_create_room_space_selection_no_space_title" = "No space selected"; "screen_create_room_space_selection_sheet_title" = "Add to space"; "screen_create_room_topic_placeholder" = "Add description…"; "screen_decline_and_block_block_user_option_description" = "You will not see any messages or room invites from this user"; @@ -611,7 +616,6 @@ "screen_labs_header_description" = "Try out our latest ideas in development. These features are not finalised; they may be unstable, may change."; "screen_labs_header_title" = "Feeling experimental?"; "screen_labs_title" = "Labs"; -"screen_leave_space_choose_owners_action" = "Choose owners"; "screen_leave_space_last_admin_info" = "%1$@ (Admin)"; "screen_leave_space_subtitle" = "Select the rooms you’d like to leave which you're not the only administrator for:"; "screen_leave_space_subtitle_last_admin" = "You need to assign another admin for this space before you can leave."; @@ -718,7 +722,6 @@ "screen_security_and_privacy_room_access_section_header" = "Access"; "screen_security_and_privacy_room_access_space_members_option_multiple_parents_description" = "Anyone in authorised spaces can join."; "screen_security_and_privacy_room_access_space_members_option_single_parent_description" = "Anyone in %1$@ can join."; -"screen_security_and_privacy_room_access_space_members_option_title" = "Space members"; "screen_security_and_privacy_room_access_space_members_option_unavailable_description" = "Spaces are not currently supported"; "screen_security_and_privacy_room_address_section_header" = "Address"; "screen_security_and_privacy_room_directory_visibility_section_footer" = "Allow for this room to be found by searching %1$@ public room directory"; @@ -875,9 +878,7 @@ "screen_create_room_action_create_room" = "New room"; "screen_create_room_error_creating_room" = "An error occurred when creating the room"; "screen_create_room_private_option_description" = "Only people invited can join."; -"screen_create_room_private_option_title" = "Private"; "screen_create_room_public_option_description" = "Anyone can find this room.\nYou can change this anytime in room settings."; -"screen_create_room_public_option_title" = "Public"; "screen_create_room_topic_label" = "Topic (optional)"; "screen_deactivate_account_confirmation_dialog_content" = "Please confirm that you want to deactivate your account. This action cannot be undone."; "screen_deactivate_account_delete_all_messages" = "Delete all my messages"; @@ -1424,6 +1425,8 @@ "screen_bottom_sheet_manage_room_member_kick_member_confirmation_description" = "They will be able to join this room again if invited."; "screen_bottom_sheet_manage_room_member_unban_member_confirmation_action" = "Unban"; "screen_bottom_sheet_manage_room_member_unbanning_user" = "Unbanning %1$@"; +"screen_create_room_room_access_section_private_option_title" = "Private"; +"screen_create_room_room_access_section_public_option_title" = "Public"; "screen_decline_and_block_block_user_option_title" = "Block user"; "screen_decline_and_block_report_user_reason_placeholder" = "Describe the reason to report…"; "screen_decline_and_block_title" = "Decline and block"; @@ -1431,6 +1434,7 @@ "screen_home_tab_spaces" = "Spaces"; "screen_join_room_decline_and_block_button_title" = "Decline and block"; "screen_knock_requests_list_title" = "Requests to join"; +"screen_leave_space_choose_owners_action" = "Choose owners"; "screen_link_new_device_desktop_scanning_title" = "Scan the QR code"; "screen_link_new_device_desktop_step3" = "Scan the QR code with this device"; "screen_link_new_device_desktop_submit" = "Ready to scan"; @@ -1455,6 +1459,7 @@ "screen_roomlist_knock_event_sent_description" = "Request to join sent"; "screen_security_and_privacy_encryption_section_header" = "Encryption"; "screen_security_and_privacy_room_access_footer_manage_spaces_action" = "Manage spaces"; +"screen_security_and_privacy_room_access_space_members_option_title" = "Space members"; "screen_security_and_privacy_room_address_section_footer" = "You’ll need an address in order to make it visible in the public directory."; "screen_space_settings_leave_space" = "Leave space"; "screen_space_settings_roles_and_permissions" = "Roles & permissions"; @@ -1474,6 +1479,8 @@ "screen_create_account_title" = "Create account"; "screen_create_poll_cancel_confirmation_content_ios" = "Your changes won’t be saved"; "screen_create_room_add_people_title" = "Invite people"; +"screen_create_room_private_option_title" = "Private"; +"screen_create_room_public_option_title" = "Public"; "screen_deactivate_account_title" = "Deactivate account"; "screen_dm_details_block_alert_action" = "Block"; "screen_dm_details_block_alert_description" = "Blocked users won't be able to send you messages and all their messages will be hidden. You can unblock them anytime."; diff --git a/ElementX/Sources/FlowCoordinators/SpaceFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/SpaceFlowCoordinator.swift index 90da8c2c8..c61158a1c 100644 --- a/ElementX/Sources/FlowCoordinators/SpaceFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/SpaceFlowCoordinator.swift @@ -39,6 +39,7 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { private let selectedSpaceRoomSubject: CurrentValueSubject = .init(nil) + private var spaceScreenCoordinator: SpaceScreenCoordinator? private var childSpaceFlowCoordinator: SpaceFlowCoordinator? private var roomFlowCoordinator: RoomFlowCoordinator? private var membersFlowCoordinator: RoomMembersFlowCoordinator? @@ -361,6 +362,7 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { appSettings: flowParameters.appSettings, userIndicatorController: flowParameters.userIndicatorController) let coordinator = SpaceScreenCoordinator(parameters: parameters) + spaceScreenCoordinator = coordinator coordinator.actionsPublisher .sink { [weak self] action in guard let self else { return } @@ -645,8 +647,10 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { switch flowCoordinatorResult { case .room(let id): stateMachine.tryEvent(.startRoomFlow(roomID: id)) + spaceScreenCoordinator?.reset() case .space(let spaceRoomListProxy): stateMachine.tryEvent(.startChildFlow, userInfo: spaceRoomListProxy) + spaceScreenCoordinator?.reset() case .cancelled, .none: break } diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 6a74f385c..2a02a59de 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -396,6 +396,10 @@ internal enum L10n { internal static var commonAbout: String { return L10n.tr("Localizable", "common_about") } /// Acceptable use policy internal static var commonAcceptableUsePolicy: String { return L10n.tr("Localizable", "common_acceptable_use_policy") } + /// Add an account + internal static var commonAddAccount: String { return L10n.tr("Localizable", "common_add_account") } + /// Add another account + internal static var commonAddAnotherAccount: String { return L10n.tr("Localizable", "common_add_another_account") } /// Adding caption internal static var commonAddingCaption: String { return L10n.tr("Localizable", "common_adding_caption") } /// Advanced settings @@ -560,6 +564,8 @@ internal enum L10n { internal static var commonNoResults: String { return L10n.tr("Localizable", "common_no_results") } /// No room name internal static var commonNoRoomName: String { return L10n.tr("Localizable", "common_no_room_name") } + /// No space name + internal static var commonNoSpaceName: String { return L10n.tr("Localizable", "common_no_space_name") } /// Not encrypted internal static var commonNotEncrypted: String { return L10n.tr("Localizable", "common_not_encrypted") } /// Offline @@ -604,10 +610,14 @@ internal enum L10n { internal static var commonPreparing: String { return L10n.tr("Localizable", "common_preparing") } /// Privacy policy internal static var commonPrivacyPolicy: String { return L10n.tr("Localizable", "common_privacy_policy") } + /// Private + internal static var commonPrivate: String { return L10n.tr("Localizable", "common_private") } /// Private room internal static var commonPrivateRoom: String { return L10n.tr("Localizable", "common_private_room") } /// Private space internal static var commonPrivateSpace: String { return L10n.tr("Localizable", "common_private_space") } + /// Public + internal static var commonPublic: String { return L10n.tr("Localizable", "common_public") } /// Public room internal static var commonPublicRoom: String { return L10n.tr("Localizable", "common_public_room") } /// Public space @@ -666,6 +676,8 @@ internal enum L10n { internal static var commonSecurity: String { return L10n.tr("Localizable", "common_security") } /// Seen by internal static var commonSeenBy: String { return L10n.tr("Localizable", "common_seen_by") } + /// Select an account + internal static var commonSelectAccount: String { return L10n.tr("Localizable", "common_select_account") } /// Plural format key: "%#@COUNT@" internal static func commonSelectedCount(_ p1: Int) -> String { return L10n.tr("Localizable", "common_selected_count", p1) @@ -704,6 +716,8 @@ internal enum L10n { internal static var commonSomethingWentWrongMessage: String { return L10n.tr("Localizable", "common_something_went_wrong_message") } /// Space internal static var commonSpace: String { return L10n.tr("Localizable", "common_space") } + /// Space members + internal static var commonSpaceMembers: String { return L10n.tr("Localizable", "common_space_members") } /// What is this space about? internal static var commonSpaceTopicPlaceholder: String { return L10n.tr("Localizable", "common_space_topic_placeholder") } /// Plural format key: "%#@COUNT@" @@ -830,6 +844,12 @@ internal enum L10n { internal static func cryptoEventKeyForwardedUnknownProfileDialogContent(_ p1: Any) -> String { return L10n.tr("Localizable", "crypto_event_key_forwarded_unknown_profile_dialog_content", String(describing: p1)) } + /// New members don't see history + internal static var cryptoHistorySharingRoomInfoHiddenBadgeContent: String { return L10n.tr("Localizable", "crypto_history_sharing_room_info_hidden_badge_content") } + /// New members see history + internal static var cryptoHistorySharingRoomInfoSharedBadgeContent: String { return L10n.tr("Localizable", "crypto_history_sharing_room_info_shared_badge_content") } + /// Anyone can see history + internal static var cryptoHistorySharingRoomInfoWorldReadableBadgeContent: String { return L10n.tr("Localizable", "crypto_history_sharing_room_info_world_readable_badge_content") } /// This room has been configured so that new members can read history. %1$@ internal static func cryptoHistoryVisible(_ p1: Any) -> String { return L10n.tr("Localizable", "crypto_history_visible", String(describing: p1)) @@ -1646,7 +1666,9 @@ internal enum L10n { internal static var screenCreateRoomRoomVisibilitySectionTitle: String { return L10n.tr("Localizable", "screen_create_room_room_visibility_section_title") } /// (no space) internal static var screenCreateRoomSpaceSelectionNoSpaceDescription: String { return L10n.tr("Localizable", "screen_create_room_space_selection_no_space_description") } - /// Home + /// Do not add to a space + internal static var screenCreateRoomSpaceSelectionNoSpaceOption: String { return L10n.tr("Localizable", "screen_create_room_space_selection_no_space_option") } + /// No space selected internal static var screenCreateRoomSpaceSelectionNoSpaceTitle: String { return L10n.tr("Localizable", "screen_create_room_space_selection_no_space_title") } /// Add to space internal static var screenCreateRoomSpaceSelectionSheetTitle: String { return L10n.tr("Localizable", "screen_create_room_space_selection_sheet_title") } @@ -3665,17 +3687,6 @@ internal enum L10n { internal static var yourAvatar: String { return L10n.tr("Localizable", "a11y.your_avatar") } } - internal enum Common { - /// Add an account - internal static var addAccount: String { return L10n.tr("Localizable", "common.add_account") } - /// Add another account - internal static var addAnotherAccount: String { return L10n.tr("Localizable", "common.add_another_account") } - /// No space name - internal static var noSpaceName: String { return L10n.tr("Localizable", "common.no_space_name") } - /// Select an account - internal static var selectAccount: String { return L10n.tr("Localizable", "common.select_account") } - } - internal enum Error { /// You're already logged in on this device as %1$@. internal static func accountAlreadyLoggedIn(_ p1: Any) -> String { diff --git a/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModel.swift b/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModel.swift index 880fcc4e1..5758f236f 100644 --- a/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModel.swift @@ -41,17 +41,21 @@ class CreateRoomScreenViewModel: CreateRoomScreenViewModelType, CreateRoomScreen var selectedSpace: SpaceServiceRoom? var canSelectSpace = false + var selectedAccessType = CreateRoomScreenAccessType.private switch spaceSelectionMode { case .editableSpacesList: canSelectSpace = true case .preSelected(let value): selectedSpace = value + if value.joinRule != .public { + selectedAccessType = .spaceMembers + } case .none: break } let bindings = CreateRoomScreenViewStateBindings(roomTopic: "", - selectedAccessType: .private, + selectedAccessType: selectedAccessType, selectedSpace: selectedSpace) super.init(initialViewState: CreateRoomScreenViewState(isSpace: isSpace, diff --git a/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomScreen.swift b/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomScreen.swift index 1bdf1ca35..3be479a54 100644 --- a/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomScreen.swift +++ b/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomScreen.swift @@ -234,13 +234,7 @@ struct CreateRoomScreen: View { context.showSpaceSelectionSheet = true }) } else { - ListRow(label: .avatar(title: L10n.screenCreateRoomSpaceSelectionNoSpaceTitle, - description: L10n.screenCreateRoomSpaceSelectionNoSpaceDescription, - icon: CompoundIcon(\.homeSolid, size: .small, relativeTo: .body) - .foregroundColor(.compound.iconPrimary) - .scaledFrame(size: 32) - .background(.compound.bgSubtleSecondary) - .clipAvatar(isSpace: true, size: 32)), + ListRow(label: .plain(title: L10n.screenCreateRoomSpaceSelectionNoSpaceTitle), kind: .navigationLink { context.showSpaceSelectionSheet = true }) diff --git a/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomSpaceSelectionSheet.swift b/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomSpaceSelectionSheet.swift index 5c2f285ce..0f27c1d6b 100644 --- a/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomSpaceSelectionSheet.swift +++ b/ElementX/Sources/Screens/CreateRoomScreen/View/CreateRoomSpaceSelectionSheet.swift @@ -24,14 +24,7 @@ struct CreateRoomSpaceSelectionSheet: View { NavigationStack { List { Section { - ListRow(label: .avatar(title: L10n.screenCreateRoomSpaceSelectionNoSpaceTitle, - description: L10n.screenCreateRoomSpaceSelectionNoSpaceDescription, - icon: CompoundIcon(\.homeSolid, size: .small, relativeTo: .body) - .foregroundColor(.compound.iconPrimary) - .scaledFrame(size: 32) - .background(.compound.bgSubtleSecondary) - .scaledFrame(size: 32) - .clipAvatar(isSpace: true, size: 32)), + ListRow(label: .plain(title: L10n.screenCreateRoomSpaceSelectionNoSpaceOption), kind: .selection(isSelected: context.selectedSpace == nil) { context.selectedSpace = nil dismiss() diff --git a/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenCoordinator.swift b/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenCoordinator.swift index c932b5441..cf9a85022 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenCoordinator.swift @@ -93,4 +93,8 @@ final class SpaceScreenCoordinator: CoordinatorProtocol { func toPresentable() -> AnyView { AnyView(SpaceScreen(context: viewModel.context)) } + + func reset() { + viewModel.reset() + } } diff --git a/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModel.swift b/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModel.swift index 0af2d6aa4..001a3f4f1 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModel.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModel.swift @@ -170,6 +170,10 @@ class SpaceScreenViewModel: SpaceScreenViewModelType, SpaceScreenViewModelProtoc state.joiningRoomIDs.removeAll() } + func reset() { + Task { await spaceRoomListProxy.resetAndWaitForFullReload(timeout: .seconds(10)) } + } + // MARK: - Private private func createChildRoom() async { diff --git a/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModelProtocol.swift index 59dc59be0..2cb43e630 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModelProtocol.swift @@ -14,4 +14,6 @@ protocol SpaceScreenViewModelProtocol { var context: SpaceScreenViewModelType.Context { get } func stop() + + func reset() }