Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions Normal/Services/TimedUnblockService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,6 @@ final class TimedUnblockService {
return timing
}

func cancelMain(
selection: FamilyActivitySelection,
customDomains: [String] = [],
screenTimeService: any ScreenTimeProviding,
blockAllPreventsAppDelete: Bool = false
) {
cancelMonitoring(activityName: SharedConstants.mainTimedUnblockActivityName)
cancelAllGroupUnblocks()
forget(id: Self.mainID)
syncHeartbeat()
screenTimeService.blockAll(
selection: selection,
customDomains: customDomains,
blockAllPreventsAppDelete: blockAllPreventsAppDelete
)
}

func cancelGroup(groupId: UUID) {
cancelMonitoring(activityName: SharedConstants.groupTimedUnblockActivityName(for: groupId))
forget(id: groupId.uuidString)
Expand Down
20 changes: 0 additions & 20 deletions NormalTests/Services/TimedUnblockServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,26 +210,6 @@ struct TimedUnblockServiceTests {
#expect(service.activeUnblockStartDates().isEmpty, "Live Activity falls back to now")
}

@Test func cancelMainAppliesShieldsAndForgets() throws {
let (service, _, store) = makeService()
let screenTime = FakeScreenTimeService()

try service.startMain(
duration: .fifteenMinutes,
selection: FamilyActivitySelection(),
screenTimeService: screenTime
)
service.cancelMain(
selection: FamilyActivitySelection(),
screenTimeService: screenTime,
blockAllPreventsAppDelete: false
)

#expect(screenTime.blockAllCalled)
#expect(store.timedUnblocks.isEmpty)
#expect(!service.isMainUnblockActive)
}

@Test func cancelGroupForgetsTheUnblock() throws {
let (service, _, store) = makeService()
let screenTime = FakeScreenTimeService()
Expand Down
Loading