diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index 42b036f..d5c1e4d 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -51,7 +51,34 @@ struct ContentView: View { #endif #if os(macOS) - PostListView(selectedCollection: model.selectedCollection, showAllPosts: model.showAllPosts) + ZStack { + PostListView(selectedCollection: nil, showAllPosts: model.account.isLoggedIn) + .toolbar { + ToolbarItemGroup(placement: .primaryAction) { + if let selectedPost = model.selectedPost { + ActivePostToolbarView(activePost: selectedPost) + .alert(isPresented: $model.isPresentingNetworkErrorAlert, content: { + Alert( + title: Text("Connection Error"), + message: Text(""" + There is no internet connection at the moment. \ + Please reconnect or try again later. + """), + dismissButton: .default(Text("OK"), action: { + model.isPresentingNetworkErrorAlert = false + }) + ) + }) + } + } + } + if model.isProcessingRequest { + ZStack { + Color(NSColor.controlBackgroundColor).opacity(0.75) + ProgressView() + } + } + } #else PostListView(selectedCollection: nil, showAllPosts: model.account.isLoggedIn) #endif diff --git a/Shared/WriteFreely_MultiPlatformApp.swift b/Shared/WriteFreely_MultiPlatformApp.swift index fda2397..4bc9109 100644 --- a/Shared/WriteFreely_MultiPlatformApp.swift +++ b/Shared/WriteFreely_MultiPlatformApp.swift @@ -1,6 +1,21 @@ import SwiftUI @main +struct CheckForDebugModifier { + static func main() { + #if os(macOS) + if NSEvent.modifierFlags.contains(.shift) { + print("Debug launch detected") + // Run debug-mode launch code here + } else { + print("Normal launch detected") + // Don't do anything + } + #endif + WriteFreely_MultiPlatformApp.main() + } +} + struct WriteFreely_MultiPlatformApp: App { @StateObject private var model = WriteFreelyModel()