feat: check exception in listen notifications use cases

This commit is contained in:
Malo Léon 2023-08-18 09:59:39 +02:00
parent 2b0fa4b578
commit f4972e629d

View File

@ -38,6 +38,10 @@ class ListenNotification extends StreamUseCase<NoParam, RemoteNotification> {
if (notificationStreamResponse.isOk) { if (notificationStreamResponse.isOk) {
notificationStream = notificationStreamResponse.ok; notificationStream = notificationStreamResponse.ok;
} else if (notificationStreamResponse.isErr) { } else if (notificationStreamResponse.isErr) {
if (notificationStreamResponse.err! is UnimplementedError) {
return Err(notificationStreamResponse.err!);
}
final notificationBackgroundStreamResponse = final notificationBackgroundStreamResponse =
await _notificationRepository.onNotificationBackground(); await _notificationRepository.onNotificationBackground();