Add support for tvOS

This commit is contained in:
世界
2023-07-29 09:44:31 +08:00
parent 5a8f3a770f
commit bb0385f53c
63 changed files with 1542 additions and 389 deletions
-22
View File
@@ -10,11 +10,6 @@ struct MainView: View {
@State private var extensionProfile: ExtensionProfile?
@State private var profileLoading = true
@State private var logClient: LogClient!
@State private var serviceNotificationTitle = ""
@State private var serviceNotificationContent = ""
@State private var serviceNotificationPresented = false
@State private var importRemoteProfile: LibboxImportRemoteProfile?
var body: some View {
@@ -30,23 +25,6 @@ struct MainView: View {
ContentView()
}
}
.alert(isPresented: $serviceNotificationPresented, content: {
Alert(
title: Text(serviceNotificationTitle),
message: Text(serviceNotificationContent),
dismissButton: .default(Text("Ok"))
)
})
.onAppear {
ServiceNotification.setServiceNotificationListener { notification in
serviceNotificationTitle = notification.title
serviceNotificationContent = notification.body
serviceNotificationPresented = true
}
}
.onDisappear {
ServiceNotification.removeServiceNotificationListener()
}
.onChange(of: scenePhase, perform: { newValue in
if newValue == .active {
Task.detached {