Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
22 changes: 11 additions & 11 deletions App/Controllers/ServerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ enum ServiceRegistry {
static let services: [any Service] = {
var services: [any Service] = [
CalendarService.shared,
CallHistoryService.shared,
CaptureService.shared,
ContactsService.shared,
LocationService.shared,
MapsService.shared,
MessageService.shared,
PhoneService.shared,
RemindersService.shared,
ShortcutsService.shared,
UtilitiesService.shared,
Expand All @@ -69,12 +69,12 @@ enum ServiceRegistry {

static func configureServices(
calendarEnabled: Binding<Bool>,
callHistoryEnabled: Binding<Bool>,
captureEnabled: Binding<Bool>,
contactsEnabled: Binding<Bool>,
locationEnabled: Binding<Bool>,
mapsEnabled: Binding<Bool>,
messagesEnabled: Binding<Bool>,
phoneEnabled: Binding<Bool>,
remindersEnabled: Binding<Bool>,
shortcutsEnabled: Binding<Bool>,
utilitiesEnabled: Binding<Bool>,
Expand All @@ -88,13 +88,6 @@ 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 @@ -130,6 +123,13 @@ enum ServiceRegistry {
service: MessageService.shared,
binding: messagesEnabled
),
ServiceConfig(
name: "Phone",
iconName: "phone.fill",
color: .green,
service: PhoneService.shared,
binding: phoneEnabled
),
ServiceConfig(
name: "Reminders",
iconName: "list.bullet",
Expand Down Expand Up @@ -175,12 +175,12 @@ 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
@AppStorage("mapsEnabled") private var mapsEnabled = true // Default enabled
@AppStorage("messagesEnabled") private var messagesEnabled = false
@AppStorage("phoneEnabled") private var phoneEnabled = false
@AppStorage("remindersEnabled") private var remindersEnabled = false
@AppStorage("shortcutsEnabled") private var shortcutsEnabled = false
@AppStorage("utilitiesEnabled") private var utilitiesEnabled = true // Default enabled
Expand All @@ -197,12 +197,12 @@ final class ServerController: ObservableObject {
var computedServiceConfigs: [ServiceConfig] {
ServiceRegistry.configureServices(
calendarEnabled: $calendarEnabled,
callHistoryEnabled: $callHistoryEnabled,
captureEnabled: $captureEnabled,
contactsEnabled: $contactsEnabled,
locationEnabled: $locationEnabled,
mapsEnabled: $mapsEnabled,
messagesEnabled: $messagesEnabled,
phoneEnabled: $phoneEnabled,
remindersEnabled: $remindersEnabled,
shortcutsEnabled: $shortcutsEnabled,
utilitiesEnabled: $utilitiesEnabled,
Expand Down
Loading