From 88969b7e782d39e382217e671733021f2bb48042 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 01:54:04 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20CodeRabbit=20Chat:=20Implement?= =?UTF-8?q?=20requested=20code=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift | 8 ++++++++ .../Domain/Interface/NotificationTokenInterface.swift | 2 +- .../Home/ViewController/NotificationsViewController.swift | 7 ++----- .../Feature/Home/ViewModel/NotificationsViewModel.swift | 6 +----- .../Feature/Quest/ViewModel/CommonQuestViewModel.swift | 3 ++- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift b/ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift index d5393fbd..7a138f6f 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift @@ -71,6 +71,14 @@ struct DataDependencyAssembler: DependencyAssembler { DIContainer.shared.register(type: NotificationInterface.self) { _ in return DefaultNotificationRepository(networkService: networkService) } + + DIContainer.shared.register(type: DefaultNotificationTokenRepository.self) { _ in + return DefaultNotificationTokenRepository( + network: networkService, + userDefaultsService: userDefaultService, + keychainService: keychainService + ) + } } } diff --git a/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/NotificationTokenInterface.swift b/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/NotificationTokenInterface.swift index 3c92561a..5e0c0d62 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/NotificationTokenInterface.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/NotificationTokenInterface.swift @@ -1,5 +1,5 @@ // -// NotificationInterface.swift +// NotificationTokenInterface.swift // ByeBoo-iOS // // Created by APPLE on 11/26/25. diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewController/NotificationsViewController.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewController/NotificationsViewController.swift index cc0cc1b4..c1e36441 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewController/NotificationsViewController.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewController/NotificationsViewController.swift @@ -36,11 +36,8 @@ final class NotificationsViewController: BaseViewController { action: #selector(back) ) - guard let notifications = notificationList?.notifications else { - return - } - - rootView.contentView.decideNoticeContent(isExistNotice: !notifications.isEmpty) + let isExistNotice = notificationList.map { !$0.notifications.isEmpty } ?? false + rootView.contentView.decideNoticeContent(isExistNotice: isExistNotice) } override func setAddTarget() { diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewModel/NotificationsViewModel.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewModel/NotificationsViewModel.swift index 6c3d8997..d43f50a1 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewModel/NotificationsViewModel.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewModel/NotificationsViewModel.swift @@ -14,10 +14,6 @@ final class NotificationsViewModel { } func formatElapsedTime(from timeString: String) -> String? { - guard let formattedTime = formatElapsedTimeUseCase.execute(from: timeString) else { - return nil - } - - return formattedTime + formatElapsedTimeUseCase.execute(from: timeString) } } diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewModel/CommonQuestViewModel.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewModel/CommonQuestViewModel.swift index a196aec7..99a5f428 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewModel/CommonQuestViewModel.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewModel/CommonQuestViewModel.swift @@ -129,6 +129,7 @@ extension CommonQuestViewModel { } func getWrittenAt(at index: Int) -> String? { - formatElapsedTimeUseCase.execute(from: answers[index].writtenAt) + guard index >= 0 && index < answers.count else { return nil } + return formatElapsedTimeUseCase.execute(from: answers[index].writtenAt) } }