Skip to content
Open
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
11 changes: 11 additions & 0 deletions App/Controllers/ServerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ enum ServiceRegistry {
static let services: [any Service] = {
var services: [any Service] = [
CalendarService.shared,
CallHistoryService.shared,
CaptureService.shared,
ContactsService.shared,
LocationService.shared,
Expand All @@ -68,6 +69,7 @@ enum ServiceRegistry {

static func configureServices(
calendarEnabled: Binding<Bool>,
callHistoryEnabled: Binding<Bool>,
captureEnabled: Binding<Bool>,
contactsEnabled: Binding<Bool>,
locationEnabled: Binding<Bool>,
Expand All @@ -86,6 +88,13 @@ enum ServiceRegistry {
service: CalendarService.shared,
binding: calendarEnabled
),
ServiceConfig(
name: "Call History",
iconName: "phone.fill",
color: .green.mix(with: .blue, by: 0.3),
service: CallHistoryService.shared,
binding: callHistoryEnabled
),
ServiceConfig(
name: "Capture",
iconName: "camera.on.rectangle.fill",
Expand Down Expand Up @@ -166,6 +175,7 @@ final class ServerController: ObservableObject {

// MARK: - AppStorage for Service Enablement States
@AppStorage("calendarEnabled") private var calendarEnabled = false
@AppStorage("callHistoryEnabled") private var callHistoryEnabled = false
@AppStorage("captureEnabled") private var captureEnabled = false
@AppStorage("contactsEnabled") private var contactsEnabled = false
@AppStorage("locationEnabled") private var locationEnabled = false
Expand All @@ -183,6 +193,7 @@ final class ServerController: ObservableObject {
var computedServiceConfigs: [ServiceConfig] {
ServiceRegistry.configureServices(
calendarEnabled: $calendarEnabled,
callHistoryEnabled: $callHistoryEnabled,
captureEnabled: $captureEnabled,
contactsEnabled: $contactsEnabled,
locationEnabled: $locationEnabled,
Expand Down
Loading