From 31f4536f47e349427d9ba168f1e35724eb13ca79 Mon Sep 17 00:00:00 2001 From: Seokki-Kwon Date: Wed, 4 Dec 2024 03:28:08 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=EC=97=B4=EB=9E=8C=EC=8B=A4=20?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=EC=8B=9C=20=EC=9D=B4=EC=A0=84=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=EA=B0=90=EC=95=88=ED=95=B4=EC=84=9C=20=EC=B0=A8?= =?UTF-8?q?=EA=B0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Domain/Interactors/StudySessionInteractor.swift | 8 +++++--- HongikYeolgong2/Injected/AppState.swift | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/HongikYeolgong2/Domain/Interactors/StudySessionInteractor.swift b/HongikYeolgong2/Domain/Interactors/StudySessionInteractor.swift index 19f07cd..67eee06 100644 --- a/HongikYeolgong2/Domain/Interactors/StudySessionInteractor.swift +++ b/HongikYeolgong2/Domain/Interactors/StudySessionInteractor.swift @@ -38,8 +38,10 @@ final class StudySessionInteractorImpl: StudySessionInteractor { /// 스터디세션을 시작합니다. func startStudy() { let startTime = appState.value.studySession.startTime + let timeDiff = Date().timeIntervalSince(startTime) + let timeDiffMinutes = TimeInterval(minutes: Int(timeDiff / 60)) let endTime = startTime + addedTime - let remainingTime = endTime.timeIntervalSince(startTime) + let remainingTime = endTime.timeIntervalSince(startTime) - timeDiffMinutes appState.bulkUpdate { appState in appState.studySession.isStudying = true @@ -164,8 +166,8 @@ final class StudySessionInteractorImpl: StudySessionInteractor { func configuredNotificationTrigger(for type: LocalNotification, endTime: TimeInterval) -> UNTimeIntervalNotificationTrigger? { let triggerTime = endTime - type.timeOffset - assert(endTime - triggerTime == type.timeOffset, "잘못된 시간이 등록되었습니다.") - assert(triggerTime > 0, "잔여 시간이 부족합니다. (필요: \(Int(type.timeOffset/60))분, 현재: \(Int(endTime/60))분)") +// assert(endTime - triggerTime == type.timeOffset, "잘못된 시간이 등록되었습니다.") +// assert(triggerTime > 0, "잔여 시간이 부족합니다. (필요: \(Int(type.timeOffset/60))분, 현재: \(Int(endTime/60))분)") guard triggerTime > 0 else { return nil diff --git a/HongikYeolgong2/Injected/AppState.swift b/HongikYeolgong2/Injected/AppState.swift index e50e677..3e83c07 100644 --- a/HongikYeolgong2/Injected/AppState.swift +++ b/HongikYeolgong2/Injected/AppState.swift @@ -52,7 +52,7 @@ extension AppState { } var totalTime: TimeInterval { - endTime.timeIntervalSince(startTime) + endTime.timeIntervalSince(firstStartTime) } } } From c51199cdaf0e8b625f015eb247da41128ed63bbd Mon Sep 17 00:00:00 2001 From: Seokki-Kwon Date: Thu, 5 Dec 2024 13:48:25 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=EC=97=B4=EB=9E=8C=EC=8B=A4=20?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=EC=8B=9C=EC=9E=91=EC=8B=9C=20=EB=B6=80?= =?UTF-8?q?=EC=97=AC=EB=90=9C=20=EC=8A=A4=ED=83=80=20=EC=82=AC=EB=9D=BC?= =?UTF-8?q?=EC=A7=90=20=ED=98=84=EC=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interactors/WeeklyStudyInteractor.swift | 4 +- .../Presentation/Home/HomeView.swift | 38 ++++++++++--------- .../Presentation/Root/RootView.swift | 6 +-- .../Util/Services/RemoteConfigManager.swift | 4 +- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/HongikYeolgong2/Domain/Interactors/WeeklyStudyInteractor.swift b/HongikYeolgong2/Domain/Interactors/WeeklyStudyInteractor.swift index b179c41..b0cad89 100644 --- a/HongikYeolgong2/Domain/Interactors/WeeklyStudyInteractor.swift +++ b/HongikYeolgong2/Domain/Interactors/WeeklyStudyInteractor.swift @@ -5,9 +5,10 @@ // Created by 권석기 on 10/28/24. // +import Combine import SwiftUI -protocol WeeklyStudyInteractor { +protocol WeeklyStudyInteractor { func getWeekyStudy(studyRecords: LoadableSubject<[WeeklyStudyRecord]>) func getWiseSaying(wiseSaying: LoadableSubject) func addStarCount(studyRecords: LoadableSubject<[WeeklyStudyRecord]>) @@ -52,6 +53,7 @@ final class WeeklyStudyInteractorImpl: WeeklyStudyInteractor { } return $0.element } + studyRecords.wrappedValue.setSuccess(value: newStudyRecords) } } diff --git a/HongikYeolgong2/Presentation/Home/HomeView.swift b/HongikYeolgong2/Presentation/Home/HomeView.swift index 1d0a82c..7268e33 100644 --- a/HongikYeolgong2/Presentation/Home/HomeView.swift +++ b/HongikYeolgong2/Presentation/Home/HomeView.swift @@ -20,10 +20,11 @@ struct HomeView: View { @State private var studySession = AppState.StudySession() @State private var studyRecords: Loadable<[WeeklyStudyRecord]> = .notRequest @State private var wiseSaying: Loadable = .notRequest - @State private var shouldShowTimePicker = false - @State private var shouldShowAddTimeModal = false - @State private var shouldShowEndUseModal = false - @State private var shouldShowWebView = false + @State private var isShowTimePicker = false + @State private var isShowAddTimeModal = false + @State private var isShowEndUseModal = false + @State private var isShowWebView = false + @State private var isViewOnAppeared = false var body: some View { NetworkStateView( @@ -61,10 +62,10 @@ struct HomeView: View { NavigationLink("", destination: WebViewWithNavigation(url: SecretKeys.roomStatusUrl, title: "좌석") .edgesIgnoringSafeArea(.bottom), - isActive: $shouldShowWebView) + isActive: $isShowWebView) .frame(width: 0, height: 0) } - .systemOverlay(isPresented: $shouldShowTimePicker) { + .systemOverlay(isPresented: $isShowTimePicker) { TimePickerView( selectedTime: Binding( get: { appState.value.studySession.startTime }, @@ -73,15 +74,15 @@ struct HomeView: View { onTimeSelected: startStudy ) } - .systemOverlay(isPresented: $shouldShowAddTimeModal) { - ModalView(isPresented: $shouldShowAddTimeModal, + .systemOverlay(isPresented: $isShowAddTimeModal) { + ModalView(isPresented: $isShowAddTimeModal, title: "열람실 이용 시간을 연장할까요?", confirmButtonText: "연장하기", cancleButtonText: "아니오", confirmAction: { studySessionInteractor.addTime() }) } - .systemOverlay(isPresented: $shouldShowEndUseModal) { - ModalView(isPresented: $shouldShowEndUseModal, + .systemOverlay(isPresented: $isShowEndUseModal) { + ModalView(isPresented: $isShowEndUseModal, title: "열람실을 다 이용하셨나요?", confirmButtonText: "네", cancleButtonText: "더 이용하기", @@ -90,8 +91,11 @@ struct HomeView: View { .padding(.horizontal, 32.adjustToScreenWidth) .modifier(IOSBackground()) .onAppear { - weeklyStudyInteractor.getWeekyStudy(studyRecords: $studyRecords) - weeklyStudyInteractor.getWiseSaying(wiseSaying: $wiseSaying) + if !isViewOnAppeared { + isViewOnAppeared = true + weeklyStudyInteractor.getWeekyStudy(studyRecords: $studyRecords) + weeklyStudyInteractor.getWiseSaying(wiseSaying: $wiseSaying) + } } .onReceive(studySessionUpdated) { studySession = $0 @@ -113,19 +117,19 @@ struct HomeView: View { // MARK: - Helpers extension HomeView { func endButtonTapped() { - shouldShowEndUseModal.toggle() + isShowEndUseModal.toggle() } func startButtonTapped() { - shouldShowTimePicker.toggle() + isShowTimePicker.toggle() } func seatButtonTapped() { - shouldShowWebView.toggle() + isShowWebView.toggle() } func addButtonTapped() { - shouldShowAddTimeModal.toggle() + isShowAddTimeModal.toggle() Amplitude.instance.track(eventType: "StudyExtendButton") } @@ -175,7 +179,7 @@ extension HomeView { .delay(for: 1, scheduler: RunLoop.main) .map { _ in } .eraseToAnyPublisher() - } + } } // MARK: - StudyContentControllerView diff --git a/HongikYeolgong2/Presentation/Root/RootView.swift b/HongikYeolgong2/Presentation/Root/RootView.swift index 6e3e122..04d110f 100644 --- a/HongikYeolgong2/Presentation/Root/RootView.swift +++ b/HongikYeolgong2/Presentation/Root/RootView.swift @@ -67,14 +67,14 @@ private extension RootView { private extension RootView { func appVersionCheck() { - Task { + Task { guard let currentVersionString = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String, let currentVersion = Int(currentVersionString.split(separator: ".").joined()), - let minimumVersion = await RemoteConfigManager.shared.getMinimumAppVersion() else { + let minimumVersion = await RemoteConfigManager.shared.getMinimumAppVersion() else { return } - guard currentVersion >= minimumVersion else { + guard currentVersion >= minimumVersion else { showAppUpdateModal.toggle() return } diff --git a/HongikYeolgong2/Util/Services/RemoteConfigManager.swift b/HongikYeolgong2/Util/Services/RemoteConfigManager.swift index 8407f32..d1b5029 100644 --- a/HongikYeolgong2/Util/Services/RemoteConfigManager.swift +++ b/HongikYeolgong2/Util/Services/RemoteConfigManager.swift @@ -9,7 +9,7 @@ import Foundation import FirebaseRemoteConfig -struct RemoteConfigManager { +class RemoteConfigManager { static let shared = RemoteConfigManager() let remoteConfig = RemoteConfig.remoteConfig() @@ -25,7 +25,7 @@ struct RemoteConfigManager { try await remoteConfig.fetch() try await remoteConfig.activate() return remoteConfig["appVersion"].numberValue.intValue - } catch { + } catch { return nil } } From 2d879a09fa4f7ee516870021acf12d17c1ce94b8 Mon Sep 17 00:00:00 2001 From: Seokki-Kwon Date: Thu, 5 Dec 2024 15:13:50 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20develop=20=EB=B3=91=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HongikYeolgong2.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/HongikYeolgong2.xcodeproj/project.pbxproj b/HongikYeolgong2.xcodeproj/project.pbxproj index eedf793..d1ef22e 100644 --- a/HongikYeolgong2.xcodeproj/project.pbxproj +++ b/HongikYeolgong2.xcodeproj/project.pbxproj @@ -1582,7 +1582,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.3; + MARKETING_VERSION = 1.1.4; PRODUCT_BUNDLE_IDENTIFIER = com.teamHY2.HongikYeolgong2; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1629,7 +1629,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.3; + MARKETING_VERSION = 1.1.4; PRODUCT_BUNDLE_IDENTIFIER = com.teamHY2.HongikYeolgong2; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/HongikYeolgong2.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/HongikYeolgong2.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index abf6629..9634acc 100644 --- a/HongikYeolgong2.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/HongikYeolgong2.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/amplitude/analytics-connector-ios.git", "state" : { - "revision" : "decb203b5ce0e06091bbc5040acbf24fa85ebdce", - "version" : "1.3.0" + "revision" : "4adbfe85486e6dcdcdca5fa9362097ffe5ec712b", + "version" : "1.3.1" } }, { @@ -60,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Kitura/BlueRSA.git", "state" : { - "revision" : "440f78db26d8bb073f29590f1c7bd31004da09ae", - "version" : "1.0.201" + "revision" : "4c9464b4a21dd558a9b1f4a4ed603bb67dcbc773", + "version" : "1.0.202" } }, { @@ -69,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk.git", "state" : { - "revision" : "dbdfdc44bee8b8e4eaa5ec27eb12b9338f3f2bc1", - "version" : "11.5.0" + "revision" : "2e02253fd1ce99145bcbf1bb367ccf61bd0ca46b", + "version" : "11.6.0" } }, { @@ -177,8 +177,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Kitura/Swift-JWT.git", "state" : { - "revision" : "f68ec28fbd90a651597e9e825ea7f315f8d52a1f", - "version" : "4.0.1" + "revision" : "2cf7ef3eeb0df84318c75662c257651285f8289f", + "version" : "4.0.2" } }, { @@ -186,8 +186,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "9cb486020ebf03bfa5b5df985387a14a98744537", - "version" : "1.6.1" + "revision" : "96a2f8a0fa41e9e09af4585e2724c4e825410b91", + "version" : "1.6.2" } }, {