Skip to content

Commit

Permalink
remove filter for notifications handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
svojsu committed Aug 5, 2024
1 parent d9f11d0 commit dbcabdf
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ final class NewReferendumHandler: CommonHandler, PushNotificationHandler {
return
}

guard chain.syncMode.enabled() else {
completion(.filteredOut)
return
}

let title = R.string.localizable.pushNotificationNewReferendumTitle(
preferredLanguages: self.locale.rLanguages
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ final class ReferendumUpdatesHandler: CommonHandler, PushNotificationHandler {
return
}

guard chain.syncMode.enabled() else {
completion(.filteredOut)
return
}

let content = self.content(from: chain)
completion(.modified(content))
case let .failure(error):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import SoraFoundation

enum PushNotificationHandleResult {
case modified(NotificationContentResult)
case filteredOut
case original(PushNotificationsHandlerErrors)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ final class StakingRewardsHandler: CommonHandler, PushNotificationHandler {
throw PushNotificationsHandlerErrors.assetNotFound(assetId: chainId)
}

guard chain.syncMode.enabled() else {
throw PushNotificationsHandlerErrors.chainDisabled
}

let priceOperation: BaseOperation<[PriceData]>
if
let priceId = asset.priceId,
Expand Down Expand Up @@ -92,8 +88,6 @@ final class StakingRewardsHandler: CommonHandler, PushNotificationHandler {
switch result {
case let .success(content):
completion(.modified(content))
case let .failure(error as PushNotificationsHandlerErrors) where error == .chainDisabled:
completion(.filteredOut)
case let .failure(error as PushNotificationsHandlerErrors):
completion(.original(error))
case let .failure(error):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ final class TransferHandler: CommonHandler, PushNotificationHandler {
throw PushNotificationsHandlerErrors.assetNotFound(assetId: chainId)
}

guard chain.syncMode.enabled() else {
throw PushNotificationsHandlerErrors.chainDisabled
}

let priceOperation: BaseOperation<[PriceData]>
if let priceId = asset.priceId,
let currency = currencyManager(operationQueue: operationQueue)?.selectedCurrency {
Expand Down Expand Up @@ -94,8 +90,6 @@ final class TransferHandler: CommonHandler, PushNotificationHandler {
switch result {
case let .success(content):
completion(.modified(content))
case let .failure(error as PushNotificationsHandlerErrors) where error == .chainDisabled:
completion(.filteredOut)
case let .failure(error as PushNotificationsHandlerErrors):
completion(.original(error))
case let .failure(error):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ final class NotificationService: UNNotificationServiceExtension {
switch handlerResult {
case let .modified(notification):
contentHandler(notification.toUserNotificationContent(with: bestAttemptContent))
case .filteredOut:
self?.logger.info("Notification skipped")
return
case let .original(error):
self?.logError(error)

Expand Down

0 comments on commit dbcabdf

Please sign in to comment.