Skip to content

Commit

Permalink
fix: SCRUM-96
Browse files Browse the repository at this point in the history
_goToNotificationSetting - runtime warning
  • Loading branch information
Jihyun247 committed Dec 19, 2024
1 parent 720e97b commit 5d8f8b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
// Copyright © 2024 PomoNyang. All rights reserved.
//

import AppService
import APIClientInterface
import UserServiceInterface
import CatServiceInterface
import UserNotificationClientInterface
import UserDefaultsClientInterface
import DatabaseClientInterface
import StreamListenerInterface
import DesignSystem
Expand Down Expand Up @@ -59,6 +61,7 @@ public struct SelectCatCore {
@Dependency(UserService.self) var userService
@Dependency(CatService.self) var catService
@Dependency(UserNotificationClient.self) var userNotificationClient
@Dependency(UserDefaultsClient.self) var userDefaultClient
@Dependency(DatabaseClient.self) var databaseClient
@Dependency(StreamListener.self) var streamListener

Expand Down Expand Up @@ -108,8 +111,10 @@ public struct SelectCatCore {
case ._setNextAction:
if state.route == .onboarding {
return .run { send in
// user notification 요청
_ = try await userNotificationClient.requestAuthorization([.alert, .badge, .sound])
let isGranted = try await userNotificationClient.requestAuthorization([.alert, .badge, .sound])
await setTimerAlarm(userDefaultsClient: self.userDefaultClient, isEnabled: isGranted)
await setDisturbAlarm(userDefaultsClient: self.userDefaultClient, isEnabled: isGranted)

await send(._moveToNamingCat)
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public struct MyPageCore {
private func core(state: inout State, action: Action) -> EffectOf<Self> {
switch action {
case .onAppear:
// TODO: userDefault get bool 은 옵셔널 값이 아니어서, 다른 방법을 사용해서 default setting 값 부여해야할듯
state.isTimerAlarmOn = getTimerAlarm(userDefaultsClient: self.userDefaultsClient)
state.isDisturbAlarmOn = getDisturbAlarm(userDefaultsClient: self.userDefaultsClient)
state.isLiveActivityOn = getLiveActivityState(userDefaultsClient: self.userDefaultsClient)
Expand Down

0 comments on commit 5d8f8b1

Please sign in to comment.