mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix Swift 6.4 warnings (#6240)
This commit is contained in:
@@ -78,7 +78,7 @@ class PollFormScreenViewModel: PollFormScreenViewModelType, PollFormScreenViewMo
|
||||
case .deleteOption(let index):
|
||||
// fixes a crash that caused an index out of range when an option with the keyboard focus was deleted
|
||||
Task {
|
||||
try await Task.sleep(for: .milliseconds(100))
|
||||
try? await Task.sleep(for: .milliseconds(100))
|
||||
guard state.bindings.options.indices.contains(index) else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -283,13 +283,13 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
// perphery: ignore - used in release mode
|
||||
func presentCrashedLastRunAlert() {
|
||||
// Delay setting the alert otherwise it automatically gets dismissed. Same as the force logout one.
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
self.state.bindings.alertInfo = AlertInfo(id: UUID(),
|
||||
title: L10n.crashDetectionDialogContent(InfoPlistReader.main.bundleDisplayName),
|
||||
primaryButton: .init(title: L10n.actionNo, action: nil),
|
||||
secondaryButton: .init(title: L10n.actionYes) { [weak self] in
|
||||
self?.actionsSubject.send(.presentFeedbackScreen)
|
||||
})
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [self] in
|
||||
state.bindings.alertInfo = AlertInfo(id: UUID(),
|
||||
title: L10n.crashDetectionDialogContent(InfoPlistReader.main.bundleDisplayName),
|
||||
primaryButton: .init(title: L10n.actionNo, action: nil),
|
||||
secondaryButton: .init(title: L10n.actionYes) { [weak self] in
|
||||
self?.actionsSubject.send(.presentFeedbackScreen)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
private static let leaveRoomLoadingID = "LeaveRoomLoading"
|
||||
|
||||
private func startLeaveRoomProcess(roomID: String) {
|
||||
Task {
|
||||
Task { [self] in
|
||||
defer {
|
||||
userIndicatorController.retractIndicatorWithId(Self.leaveRoomLoadingID)
|
||||
}
|
||||
|
||||
+4
-4
@@ -88,7 +88,7 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
|
||||
let eventID = request.eventID
|
||||
state.handledEventIDs.insert(eventID)
|
||||
|
||||
Task {
|
||||
Task { [self] in
|
||||
switch await request.accept() {
|
||||
case .success:
|
||||
hideLoadingIndicator()
|
||||
@@ -110,7 +110,7 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
|
||||
let eventID = request.eventID
|
||||
state.handledEventIDs.insert(eventID)
|
||||
|
||||
Task {
|
||||
Task { [self] in
|
||||
switch await request.decline() {
|
||||
case .success:
|
||||
hideLoadingIndicator()
|
||||
@@ -132,7 +132,7 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
|
||||
let eventID = request.eventID
|
||||
state.handledEventIDs.insert(eventID)
|
||||
|
||||
Task {
|
||||
Task { [self] in
|
||||
switch await request.ban() {
|
||||
case .success:
|
||||
hideLoadingIndicator()
|
||||
@@ -155,7 +155,7 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
|
||||
showLoadingIndicator(title: L10n.screenKnockRequestsListAcceptAllLoadingTitle)
|
||||
state.handledEventIDs.formUnion(Set(requests.map(\.eventID)))
|
||||
|
||||
Task {
|
||||
Task { [self] in
|
||||
let failedIDs = await withTaskGroup(of: (String, Result<Void, KnockRequestProxyError>).self) { group in
|
||||
for request in requests {
|
||||
group.addTask {
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ private class ElementTextView: UITextView, PillAttachmentViewProviderDelegate {
|
||||
super.init(frame: .zero, textContainer: nil)
|
||||
|
||||
// Avoid `Publishing changes from within view update` warnings
|
||||
DispatchQueue.main.async {
|
||||
DispatchQueue.main.async { [self] in
|
||||
presendCallback.wrappedValue = { [weak self] in
|
||||
self?.acceptCurrentSuggestion()
|
||||
}
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ class NotificationSettingsEditScreenViewModel: NotificationSettingsEditScreenVie
|
||||
roomNotificationModeProxy = .mentionsAndKeywordsOnly
|
||||
}
|
||||
state.pendingMode = mode
|
||||
Task {
|
||||
Task { [self] in
|
||||
do {
|
||||
// On modern clients, we don't have different settings for encrypted and non-encrypted rooms.
|
||||
let isOneToOne = chatType == .oneToOneChat
|
||||
|
||||
@@ -72,7 +72,7 @@ class SpaceScreenViewModel: SpaceScreenViewModelType, SpaceScreenViewModelProtoc
|
||||
.weakAssign(to: \.state.selectedSpaceRoomID, on: self)
|
||||
.store(in: &cancellables)
|
||||
|
||||
Task {
|
||||
Task { [self] in
|
||||
if case let .joined(roomProxy) = await userSession.clientProxy.roomForIdentifier(spaceRoomListProxy.id) {
|
||||
// Required to listen for membership updates in the members flow
|
||||
await roomProxy.subscribeForUpdates()
|
||||
|
||||
Reference in New Issue
Block a user