Skip to content

Commit

Permalink
[Chore/#30] 변수명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed May 14, 2024
1 parent 1bd50a6 commit 803d27d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions HMH_iOS/HMH_iOS/Presentation/Challenge/Views/ChallengeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct ChallengeView: View {
@State var isPresented = false
@State private var selection = FamilyActivitySelection() {
didSet {
screenTimeViewMode.selectionToDiscourage = selection
screenTimeViewMode.selectedApp = selection
}
}
var challengeDays = 14
Expand Down Expand Up @@ -92,7 +92,7 @@ extension ChallengeView {
}
.padding(.horizontal, 20)
DeviceActivityReport(context, filter: filter)
.frame(height: 72 * CGFloat(screenTimeViewMode.selectionToDiscourage.applicationTokens.count))
.frame(height: 72 * CGFloat(screenTimeViewMode.selectedApp.applicationTokens.count))
Button(action: {
isPresented = true
}, label: {
Expand All @@ -102,10 +102,12 @@ extension ChallengeView {
selection: $selection)
.onChange(of: selection) { newSelection in
selection = newSelection

screenTimeViewMode.handleStartDeviceActivityMonitoring(interval: 1)
}
}
.onAppear() {
selection = screenTimeViewMode.selectionToDiscourage
selection = screenTimeViewMode.selectedApp
filter = DeviceActivityFilter(
segment: .daily(
during: Calendar.current.dateInterval(
Expand All @@ -114,8 +116,8 @@ extension ChallengeView {
),
users: .all,
devices: .init([.iPhone]),
applications: screenTimeViewMode.selectionToDiscourage.applicationTokens,
categories: screenTimeViewMode.selectionToDiscourage.categoryTokens
applications: screenTimeViewMode.selectedApp.applicationTokens,
categories: screenTimeViewMode.selectedApp.categoryTokens
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions HMH_iOS/HMH_iOS/Presentation/Home/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ struct HomeView: View {
),
users: .all,
devices: .init([.iPhone]),
applications: screenTimeViewModel.selectionToDiscourage.applicationTokens,
categories: screenTimeViewModel.selectionToDiscourage.categoryTokens
applications: screenTimeViewModel.selectedApp.applicationTokens,
categories: screenTimeViewModel.selectedApp.categoryTokens
)
}
}
Expand All @@ -61,7 +61,7 @@ extension HomeView {
VStack {
headerView
DeviceActivityReport(appContext, filter: appFilter)
.frame(height: 80 * CGFloat(screenTimeViewModel.selectionToDiscourage.applicationTokens.count))
.frame(height: 80 * CGFloat(screenTimeViewModel.selectedApp.applicationTokens.count))
.padding(.bottom, 20)
}
}
Expand Down

0 comments on commit 803d27d

Please sign in to comment.