Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Show email and push alert for RuuviCloud users #1255 #2130

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import RuuviLocal
import RuuviLocalization
import RuuviService
import RuuviUser
import UIKit

protocol NotificationsSettingsModuleFactory {
Expand All @@ -20,6 +21,7 @@ final class NotificationsSettingsModuleFactoryImpl: NotificationsSettingsModuleF
let presenter = NotificationsSettingsPresenter()
presenter.view = view
presenter.settings = r.resolve(RuuviLocalSettings.self)
presenter.ruuviUser = r.resolve(RuuviUser.self)
presenter.ruuviAppSettingsService = r.resolve(RuuviServiceAppSettings.self)
presenter.cloudNotificationService = r.resolve(RuuviServiceCloudNotification.self)
presenter.router = router
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import RuuviLocal
import RuuviLocalization
import RuuviOntology
import RuuviService
import RuuviUser
import UIKit

class NotificationsSettingsPresenter: NSObject, NotificationsSettingsModuleInput {
weak var view: NotificationsSettingsViewInput?
var router: NotificationsSettingsRouterInput!

var settings: RuuviLocalSettings!
var ruuviUser: RuuviUser!
var ruuviAppSettingsService: RuuviServiceAppSettings!
var cloudNotificationService: RuuviServiceCloudNotification!

Expand Down Expand Up @@ -56,8 +58,12 @@ extension NotificationsSettingsPresenter {
var viewModels: [NotificationsSettingsViewModel] = []

viewModels.append(buildLimitAlertNotificationsSettings())
viewModels.append(buildEmailAlertSettings())
viewModels.append(buildPushSettings())

if ruuviUser.isAuthorized {
viewModels.append(buildEmailAlertSettings())
viewModels.append(buildPushSettings())
}

viewModels.append(buildSoundSettings())

settingsViewModels = viewModels
Expand Down
Loading