From 720e97b247cc748631d22461281e790788cafa6e Mon Sep 17 00:00:00 2001 From: Jihyun247 Date: Wed, 18 Dec 2024 22:10:17 +0900 Subject: [PATCH 1/2] chore: SCRUM-106 --- .../Feature/HomeFeature/Sources/Home/HomeView.swift | 2 +- .../16/16_offline.imageset/16_offline.svg | 10 ++++++++++ .../16/16_offline.imageset/Contents.json | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/16_offline.svg create mode 100644 Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/Contents.json diff --git a/Projects/Feature/HomeFeature/Sources/Home/HomeView.swift b/Projects/Feature/HomeFeature/Sources/Home/HomeView.swift index ca0f80f..d1dbca7 100644 --- a/Projects/Feature/HomeFeature/Sources/Home/HomeView.swift +++ b/Projects/Feature/HomeFeature/Sources/Home/HomeView.swift @@ -108,7 +108,7 @@ public struct HomeView: View { if !store.isNetworkConnected { VStack { HStack(spacing: Alias.Spacing.small) { - DesignSystemAsset.Image._16NullPrimary.swiftUIImage + DesignSystemAsset.Image._16Offline.swiftUIImage Text("오프라인 모드") .font(Typography.bodySB) .foregroundStyle(Alias.Color.Text.secondary) diff --git a/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/16_offline.svg b/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/16_offline.svg new file mode 100644 index 0000000..611eeea --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/16_offline.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/Contents.json b/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/Contents.json new file mode 100644 index 0000000..ab95d65 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "16_offline.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} From 5d8f8b1c3aae57b85126376235a743a94de8f80a Mon Sep 17 00:00:00 2001 From: Jihyun247 Date: Thu, 19 Dec 2024 13:23:10 +0900 Subject: [PATCH 2/2] fix: SCRUM-96 _goToNotificationSetting - runtime warning --- .../CatFeature/Sources/SelectCat/SelectCatCore.swift | 9 +++++++-- .../MyPageFeature/Sources/MyPage/MyPageCore.swift | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatCore.swift b/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatCore.swift index 8b3afc9..eb02d51 100644 --- a/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatCore.swift +++ b/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatCore.swift @@ -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 @@ -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 @@ -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 { diff --git a/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageCore.swift b/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageCore.swift index 5ca1c7b..d27008b 100644 --- a/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageCore.swift +++ b/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageCore.swift @@ -80,7 +80,6 @@ public struct MyPageCore { private func core(state: inout State, action: Action) -> EffectOf { 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)