@@ -19,13 +19,14 @@ struct Main: View {
1919 case outing
2020 }
2121
22- @EnvironmentObject private var popupState : PopupStateModel
22+ @EnvironmentObject private var user : User
2323 @EnvironmentObject private var challengeState : ChallengeState
24- @EnvironmentObject private var shareViewModel : ShareViewModel
24+ @StateObject private var shareViewModel = ShareViewModel ( )
25+ @StateObject private var badgeViewModel = BadgeViewModel ( )
26+
27+ @EnvironmentObject private var popupState : PopupStateModel
2528 @EnvironmentObject private var locationManager : LocationManager
26- @EnvironmentObject private var user : User
2729 @EnvironmentObject private var rootManager : RootViewManager
28- @StateObject private var badgeViewModel = BadgeViewModel ( )
2930
3031 @State var sharePresented : Bool = false
3132 @State var bannerDetailPresented : Bool = false
@@ -44,14 +45,20 @@ struct Main: View {
4445 NavigationLink (
4546 destination: Share (
4647 shareType: ShareType . slide,
48+ shareViewModel: shareViewModel,
4749 badgeViewModel: badgeViewModel
4850 ) ,
4951 isActive: $sharePresented
5052 ) { EmptyView ( ) }
53+
5154 NavigationLink (
52- destination: MyPage ( badgeViewModel: badgeViewModel) ,
55+ destination: MyPage (
56+ shareViewModel: shareViewModel,
57+ badgeViewModel: badgeViewModel
58+ ) ,
5359 isActive: $mypagePresented
5460 ) { EmptyView ( ) }
61+
5562 NavigationLink (
5663 destination: NewItemShare ( badgeQueue: $badgeViewModel. badgeQueue, seconds: user. accumulateSeconds) ,
5764 isActive: $showNewBadge
@@ -149,9 +156,9 @@ struct Main: View {
149156 }
150157
151158 func addChallengeTimer( ) {
152- user. accumulateSeconds += 3600
153- shareViewModel. seconds += 3600
154- challengeState. timeData. minute += 60
159+ user. accumulateSeconds += 1
160+ shareViewModel. seconds += 1
161+ challengeState. timeData. second += 1
155162 if challengeState. timeData. minute >= 60 {
156163 challengeState. timeData. hour += 1
157164 challengeState. timeData. minute = 0
0 commit comments