mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Show a modal indicator while inviting users to a room.
This commit is contained in:
committed by
Stefan Ceriu
parent
72b99d89dd
commit
ca4e92906c
@@ -97,6 +97,7 @@
|
|||||||
"action_leave" = "Leave";
|
"action_leave" = "Leave";
|
||||||
"action_leave_conversation" = "Leave conversation";
|
"action_leave_conversation" = "Leave conversation";
|
||||||
"action_leave_room" = "Leave room";
|
"action_leave_room" = "Leave room";
|
||||||
|
"action_leave_space" = "Leave space";
|
||||||
"action_load_more" = "Load more";
|
"action_load_more" = "Load more";
|
||||||
"action_manage_account" = "Manage account";
|
"action_manage_account" = "Manage account";
|
||||||
"action_manage_devices" = "Manage devices";
|
"action_manage_devices" = "Manage devices";
|
||||||
@@ -482,6 +483,9 @@
|
|||||||
"screen_bottom_sheet_create_dm_confirmation_button_title" = "Send invite";
|
"screen_bottom_sheet_create_dm_confirmation_button_title" = "Send invite";
|
||||||
"screen_bottom_sheet_create_dm_message" = "Would you like to start a chat with %1$@?";
|
"screen_bottom_sheet_create_dm_message" = "Would you like to start a chat with %1$@?";
|
||||||
"screen_bottom_sheet_create_dm_title" = "Send invite?";
|
"screen_bottom_sheet_create_dm_title" = "Send invite?";
|
||||||
|
"screen_bottom_sheet_leave_space_subtitle" = "This will also remove you from all rooms in this space.";
|
||||||
|
"screen_bottom_sheet_leave_space_subtitle_admin" = "This will also remove you from all rooms in this space, including those you’re the only administrator for:";
|
||||||
|
"screen_bottom_sheet_leave_space_title" = "Leave %1$@?";
|
||||||
"screen_bottom_sheet_manage_room_member_ban" = "Ban from room";
|
"screen_bottom_sheet_manage_room_member_ban" = "Ban from room";
|
||||||
"screen_bottom_sheet_manage_room_member_ban_member_confirmation_action" = "Ban";
|
"screen_bottom_sheet_manage_room_member_ban_member_confirmation_action" = "Ban";
|
||||||
"screen_bottom_sheet_manage_room_member_ban_member_confirmation_description" = "They won’t be able to join this room again if invited.";
|
"screen_bottom_sheet_manage_room_member_ban_member_confirmation_description" = "They won’t be able to join this room again if invited.";
|
||||||
@@ -1000,6 +1004,8 @@
|
|||||||
"screen_room_details_error_loading_notification_settings" = "An error occurred when loading notification settings.";
|
"screen_room_details_error_loading_notification_settings" = "An error occurred when loading notification settings.";
|
||||||
"screen_room_details_error_muting" = "Failed muting this room, please try again.";
|
"screen_room_details_error_muting" = "Failed muting this room, please try again.";
|
||||||
"screen_room_details_error_unmuting" = "Failed unmuting this room, please try again.";
|
"screen_room_details_error_unmuting" = "Failed unmuting this room, please try again.";
|
||||||
|
"screen_room_details_invite_people_dont_close" = "Don't close the app until finished.";
|
||||||
|
"screen_room_details_invite_people_preparing" = "Preparing invitations...";
|
||||||
"screen_room_details_notification_mode_custom" = "Custom";
|
"screen_room_details_notification_mode_custom" = "Custom";
|
||||||
"screen_room_details_notification_mode_default" = "Default";
|
"screen_room_details_notification_mode_default" = "Default";
|
||||||
"screen_room_details_share_room_title" = "Share room";
|
"screen_room_details_share_room_title" = "Share room";
|
||||||
|
|||||||
@@ -1279,9 +1279,19 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func inviteUsers(_ users: [String], in room: JoinedRoomProxyProtocol) {
|
private func inviteUsers(_ users: [String], in room: JoinedRoomProxyProtocol) {
|
||||||
navigationStackCoordinator.setSheetCoordinator(nil)
|
if flowParameters.appSettings.enableKeyShareOnInvite {
|
||||||
|
showLoadingIndicator(title: L10n.screenRoomDetailsInvitePeoplePreparing,
|
||||||
|
message: L10n.screenRoomDetailsInvitePeopleDontClose)
|
||||||
|
} else {
|
||||||
|
showLoadingIndicator()
|
||||||
|
}
|
||||||
|
|
||||||
Task {
|
Task {
|
||||||
|
defer {
|
||||||
|
navigationStackCoordinator.setSheetCoordinator(nil)
|
||||||
|
hideLoadingIndicator()
|
||||||
|
}
|
||||||
|
|
||||||
let result: Result<Void, RoomProxyError> = await withTaskGroup(of: Result<Void, RoomProxyError>.self) { group in
|
let result: Result<Void, RoomProxyError> = await withTaskGroup(of: Result<Void, RoomProxyError>.self) { group in
|
||||||
for user in users {
|
for user in users {
|
||||||
group.addTask {
|
group.addTask {
|
||||||
@@ -1530,12 +1540,16 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
|||||||
|
|
||||||
private static let loadingIndicatorID = "\(RoomFlowCoordinator.self)-Loading"
|
private static let loadingIndicatorID = "\(RoomFlowCoordinator.self)-Loading"
|
||||||
|
|
||||||
private func showLoadingIndicator(delay: Duration? = nil) {
|
private func showLoadingIndicator(delay: Duration? = nil,
|
||||||
|
title: String = L10n.commonLoading,
|
||||||
|
message: String? = nil) {
|
||||||
flowParameters.userIndicatorController.submitIndicator(.init(id: Self.loadingIndicatorID,
|
flowParameters.userIndicatorController.submitIndicator(.init(id: Self.loadingIndicatorID,
|
||||||
type: .modal(progress: .indeterminate,
|
type: .modal(progress: .indeterminate,
|
||||||
interactiveDismissDisabled: false,
|
interactiveDismissDisabled: false,
|
||||||
allowsInteraction: false),
|
allowsInteraction: false),
|
||||||
title: L10n.commonLoading, persistent: true),
|
title: title,
|
||||||
|
message: message,
|
||||||
|
persistent: true),
|
||||||
delay: delay)
|
delay: delay)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,6 +232,8 @@ internal enum L10n {
|
|||||||
internal static var actionLeaveConversation: String { return L10n.tr("Localizable", "action_leave_conversation") }
|
internal static var actionLeaveConversation: String { return L10n.tr("Localizable", "action_leave_conversation") }
|
||||||
/// Leave room
|
/// Leave room
|
||||||
internal static var actionLeaveRoom: String { return L10n.tr("Localizable", "action_leave_room") }
|
internal static var actionLeaveRoom: String { return L10n.tr("Localizable", "action_leave_room") }
|
||||||
|
/// Leave space
|
||||||
|
internal static var actionLeaveSpace: String { return L10n.tr("Localizable", "action_leave_space") }
|
||||||
/// Load more
|
/// Load more
|
||||||
internal static var actionLoadMore: String { return L10n.tr("Localizable", "action_load_more") }
|
internal static var actionLoadMore: String { return L10n.tr("Localizable", "action_load_more") }
|
||||||
/// Manage account
|
/// Manage account
|
||||||
@@ -1278,6 +1280,14 @@ internal enum L10n {
|
|||||||
}
|
}
|
||||||
/// Send invite?
|
/// Send invite?
|
||||||
internal static var screenBottomSheetCreateDmTitle: String { return L10n.tr("Localizable", "screen_bottom_sheet_create_dm_title") }
|
internal static var screenBottomSheetCreateDmTitle: String { return L10n.tr("Localizable", "screen_bottom_sheet_create_dm_title") }
|
||||||
|
/// This will also remove you from all rooms in this space.
|
||||||
|
internal static var screenBottomSheetLeaveSpaceSubtitle: String { return L10n.tr("Localizable", "screen_bottom_sheet_leave_space_subtitle") }
|
||||||
|
/// This will also remove you from all rooms in this space, including those you’re the only administrator for:
|
||||||
|
internal static var screenBottomSheetLeaveSpaceSubtitleAdmin: String { return L10n.tr("Localizable", "screen_bottom_sheet_leave_space_subtitle_admin") }
|
||||||
|
/// Leave %1$@?
|
||||||
|
internal static func screenBottomSheetLeaveSpaceTitle(_ p1: Any) -> String {
|
||||||
|
return L10n.tr("Localizable", "screen_bottom_sheet_leave_space_title", String(describing: p1))
|
||||||
|
}
|
||||||
/// Ban from room
|
/// Ban from room
|
||||||
internal static var screenBottomSheetManageRoomMemberBan: String { return L10n.tr("Localizable", "screen_bottom_sheet_manage_room_member_ban") }
|
internal static var screenBottomSheetManageRoomMemberBan: String { return L10n.tr("Localizable", "screen_bottom_sheet_manage_room_member_ban") }
|
||||||
/// Ban
|
/// Ban
|
||||||
@@ -2302,6 +2312,10 @@ internal enum L10n {
|
|||||||
internal static var screenRoomDetailsErrorMuting: String { return L10n.tr("Localizable", "screen_room_details_error_muting") }
|
internal static var screenRoomDetailsErrorMuting: String { return L10n.tr("Localizable", "screen_room_details_error_muting") }
|
||||||
/// Failed unmuting this room, please try again.
|
/// Failed unmuting this room, please try again.
|
||||||
internal static var screenRoomDetailsErrorUnmuting: String { return L10n.tr("Localizable", "screen_room_details_error_unmuting") }
|
internal static var screenRoomDetailsErrorUnmuting: String { return L10n.tr("Localizable", "screen_room_details_error_unmuting") }
|
||||||
|
/// Don't close the app until finished.
|
||||||
|
internal static var screenRoomDetailsInvitePeopleDontClose: String { return L10n.tr("Localizable", "screen_room_details_invite_people_dont_close") }
|
||||||
|
/// Preparing invitations...
|
||||||
|
internal static var screenRoomDetailsInvitePeoplePreparing: String { return L10n.tr("Localizable", "screen_room_details_invite_people_preparing") }
|
||||||
/// Invite people
|
/// Invite people
|
||||||
internal static var screenRoomDetailsInvitePeopleTitle: String { return L10n.tr("Localizable", "screen_room_details_invite_people_title") }
|
internal static var screenRoomDetailsInvitePeopleTitle: String { return L10n.tr("Localizable", "screen_room_details_invite_people_title") }
|
||||||
/// Leave conversation
|
/// Leave conversation
|
||||||
|
|||||||
Reference in New Issue
Block a user