diff --git a/Keychy/Keychy/Presentation/Bundle/ViewModels/BundleViewModel.swift b/Keychy/Keychy/Presentation/Bundle/ViewModels/BundleViewModel.swift index f9c57f96..d4e4b139 100644 --- a/Keychy/Keychy/Presentation/Bundle/ViewModels/BundleViewModel.swift +++ b/Keychy/Keychy/Presentation/Bundle/ViewModels/BundleViewModel.swift @@ -65,6 +65,15 @@ class BundleViewModel { var selectedBundle: KeyringBundle? + /// 메인 뭉치로 selected* 상태 복원 (상세/완성 화면에서 나갈 때 호출) + /// 홈 화면이 공유 bundleVM을 참조하므로, 다른 화면에서 변경된 상태를 정리 + func restoreMainBundle() { + guard let mainBundle = sortedBundles.first(where: { $0.isMain }) ?? sortedBundles.first else { return } + selectedBundle = mainBundle + selectedBackground = resolveBackground(from: mainBundle.selectedBackground) + selectedCarabiner = resolveCarabiner(from: mainBundle.selectedCarabiner) + } + // MARK: - 사용자 데이터 var bundles: [KeyringBundle] = [] diff --git a/Keychy/Keychy/Presentation/Bundle/Views/Complete/BundleCompleteView.swift b/Keychy/Keychy/Presentation/Bundle/Views/Complete/BundleCompleteView.swift index d90fe4f9..e2865fd2 100644 --- a/Keychy/Keychy/Presentation/Bundle/Views/Complete/BundleCompleteView.swift +++ b/Keychy/Keychy/Presentation/Bundle/Views/Complete/BundleCompleteView.swift @@ -282,6 +282,7 @@ extension BundleCompleteView { ToolbarItem(placement: .topBarLeading) { Button { cleanupCachedVideo() + bundleVM.restoreMainBundle() TabBarManager.switchTo(.workshop) TabBarManager.show() router.reset() @@ -318,6 +319,7 @@ extension BundleCompleteView { private func navigateToInventory() { cleanupCachedVideo() + bundleVM.restoreMainBundle() CollectionViewModel.shouldStartWithBundleTab = true TabBarManager.switchTo(.collection) TabBarManager.show() diff --git a/Keychy/Keychy/Presentation/Bundle/Views/Create/BundleCreateView+Initialization.swift b/Keychy/Keychy/Presentation/Bundle/Views/Create/BundleCreateView+Initialization.swift index 125060a3..590e56ec 100644 --- a/Keychy/Keychy/Presentation/Bundle/Views/Create/BundleCreateView+Initialization.swift +++ b/Keychy/Keychy/Presentation/Bundle/Views/Create/BundleCreateView+Initialization.swift @@ -86,7 +86,7 @@ extension BundleCreateView { // 미리 선택된 배경이 없으면 "퍼플키치"를 기본으로 선택 if bundleVM.newSelectedBackground == nil { bundleVM.newSelectedBackground = bundleVM.backgroundViewData.first { bg in - bg.background.backgroundName == "퍼플키치" + bg.background.backgroundName == "퍼플 키치" } ?? bundleVM.backgroundViewData.first } } diff --git a/Keychy/Keychy/Presentation/Bundle/Views/Create/BundleCreateView.swift b/Keychy/Keychy/Presentation/Bundle/Views/Create/BundleCreateView.swift index 223fbccb..2c40c0b5 100644 --- a/Keychy/Keychy/Presentation/Bundle/Views/Create/BundleCreateView.swift +++ b/Keychy/Keychy/Presentation/Bundle/Views/Create/BundleCreateView.swift @@ -178,6 +178,7 @@ extension BundleCreateView { var customNavigationBar: some View { CustomNavigationBar { BackToolbarButton { + bundleVM.restoreMainBundle() TabBarManager.show() router.pop() } diff --git a/Keychy/Keychy/Presentation/Bundle/Views/Detail/BundleDetailView.swift b/Keychy/Keychy/Presentation/Bundle/Views/Detail/BundleDetailView.swift index 64082905..7b1e8125 100644 --- a/Keychy/Keychy/Presentation/Bundle/Views/Detail/BundleDetailView.swift +++ b/Keychy/Keychy/Presentation/Bundle/Views/Detail/BundleDetailView.swift @@ -392,6 +392,12 @@ extension BundleDetailView { bundleVM.lastCarabinerIdForDetail = "" bundleVM.lastBackgroundIdForDetail = "" router.pop() + + // pop 애니메이션 완료 후 메인 뭉치로 복원 + Task { @MainActor in + try? await Task.sleep(for: .milliseconds(350)) + bundleVM.restoreMainBundle() + } } Spacer() diff --git a/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/collectionGuiding.imageset/collectionGuiding.pdf b/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/collectionGuiding.imageset/collectionGuiding.pdf index fd8ac1f3..3e979c9b 100644 Binary files a/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/collectionGuiding.imageset/collectionGuiding.pdf and b/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/collectionGuiding.imageset/collectionGuiding.pdf differ diff --git a/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/Contents.json b/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/Contents.json index e4c148d4..a2b896e2 100644 --- a/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/Contents.json +++ b/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "d.pdf", + "filename" : "homeGuiding.pdf", "idiom" : "universal" } ], diff --git a/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/d.pdf b/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/homeGuiding.pdf similarity index 98% rename from Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/d.pdf rename to Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/homeGuiding.pdf index 7a3e3a6d..f5729aea 100644 Binary files a/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/d.pdf and b/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/homeGuiding.imageset/homeGuiding.pdf differ diff --git a/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/workshopGuiding.imageset/workshopGuiding.pdf b/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/workshopGuiding.imageset/workshopGuiding.pdf index 8fbf168e..921e53de 100644 Binary files a/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/workshopGuiding.imageset/workshopGuiding.pdf and b/Keychy/Keychy/Resources/Assets.xcassets/15. IntroGuiding/workshopGuiding.imageset/workshopGuiding.pdf differ