feat(gift): 선물 화면 경로를 등록한다

This commit is contained in:
Yu Sung
2026-10-08 12:33:14 +09:00
parent fedebf825f
commit 8d3d7f6ba1
4 changed files with 349 additions and 1 deletions
+11 -1
View File
@@ -139,8 +139,17 @@ class AppState: ObservableObject {
}
}
func replaceCurrentAppStep(step: AppStep) {
func replaceCurrentAppStep(
step: AppStep,
ifCurrentStep matches: ((AppStep) -> Bool)? = nil,
completion: @escaping (Bool) -> Void = { _ in }
) {
DispatchQueue.main.async {
guard matches?(self.appStep) ?? true else {
completion(false)
return
}
if let route = self.navigationPath.popLast() {
self.routeStepMap.removeValue(forKey: route)
}
@@ -149,6 +158,7 @@ class AppState: ObservableObject {
self.routeStepMap[route] = step
self.navigationPath.append(route)
self.appStep = step
completion(true)
}
}