Add preview support

This commit is contained in:
世界 committed 2023-07-20 13:15:13 +08:00
1 parent fdbf50d875
commit 251f441a25
14 files changed
+135 -59

No files matched your search

+4
View File
@@ -54,12 +54,16 @@ struct MainView: View {
.environment(\.selection, $selection)
.environment(\.extensionProfile, $extensionProfile)
.environment(\.logClient, $logClient)
.preferredColorScheme(.dark)
}
private func loadProfile() async {
defer {
profileLoading = false
}
if ApplicationLibrary.inPreview {
return
}
if let newProfile = try? await ExtensionProfile.load() {
if extensionProfile == nil || extensionProfile?.status == .invalid {
newProfile.register()