Replace completion handlers with async/await. (#407)

This commit is contained in:
Doug
2023-01-05 16:43:41 +00:00
committed by GitHub
parent 51e300642c
commit e4d087a0a4
8 changed files with 70 additions and 109 deletions
@@ -302,7 +302,7 @@ class AppCoordinator: AppCoordinatorProtocol {
.sink { [weak self] callback in
switch callback {
case .registeredNotifications(let deviceToken):
self?.notificationManager?.register(with: deviceToken, completion: nil)
Task { await self?.notificationManager?.register(with: deviceToken) }
case .failedToRegisteredNotifications(let error):
self?.notificationManager?.registrationFailed(with: error)
}
@@ -467,8 +467,8 @@ extension AppCoordinator: NotificationManagerDelegate {
break
default:
// error or no room proxy
service.showLocalNotification(with: "⚠️ " + ElementL10n.dialogTitleError,
subtitle: ElementL10n.a11yErrorSomeMessageNotSent)
await service.showLocalNotification(with: "⚠️ " + ElementL10n.dialogTitleError,
subtitle: ElementL10n.a11yErrorSomeMessageNotSent)
}
}
}