Restart service when settings change

This commit is contained in:
世界
2025-12-07 10:28:51 +08:00
parent bd5e5f3a79
commit 39338ab133
10 changed files with 77 additions and 22 deletions
+2 -6
View File
@@ -38,9 +38,7 @@ struct StartServiceIntent: AppIntent {
}
try LibboxNewStandaloneCommandClient()!.serviceReload()
} else if extensionProfile.status.isConnected {
try await extensionProfile.stop()
try await Task.sleep(nanoseconds: UInt64(100 * Double(NSEC_PER_MSEC)))
try await extensionProfile.start()
try await extensionProfile.restart()
} else {
try await extensionProfile.start()
}
@@ -65,9 +63,7 @@ struct RestartServiceIntent: AppIntent {
if extensionProfile.status == .connected {
try LibboxNewStandaloneCommandClient()!.serviceReload()
} else if extensionProfile.status.isConnected {
try await extensionProfile.stop()
try await Task.sleep(nanoseconds: UInt64(100 * Double(NSEC_PER_MSEC)))
try await extensionProfile.start()
try await extensionProfile.restart()
} else {
try await extensionProfile.start()
}