diff --git a/Tusker/Screens/Compose/ComposeView.swift b/Tusker/Screens/Compose/ComposeView.swift index 6d74e4cd..977951ff 100644 --- a/Tusker/Screens/Compose/ComposeView.swift +++ b/Tusker/Screens/Compose/ComposeView.swift @@ -111,7 +111,7 @@ struct ComposeView: View { }) .navigationTitle(navTitle) .sheet(isPresented: $uiState.isShowingDraftsList) { - DraftsView(currentDraft: draft) + DraftsView(currentDraft: draft, mastodonController: mastodonController) } .actionSheet(isPresented: $uiState.isShowingSaveDraftSheet, content: self.saveAndCloseSheet) .alert(isPresented: $isShowingPostErrorAlert) { diff --git a/Tusker/Screens/Compose/DraftsView.swift b/Tusker/Screens/Compose/DraftsView.swift index f2348b7f..733d90e1 100644 --- a/Tusker/Screens/Compose/DraftsView.swift +++ b/Tusker/Screens/Compose/DraftsView.swift @@ -10,8 +10,9 @@ import SwiftUI struct DraftsView: View { let currentDraft: Draft + // don't pass this in via the environment b/c it crashes on macOS (at least, in Designed for iPad mode) since the environment doesn't get propagated through the modal popup window or something + let mastodonController: MastodonController @EnvironmentObject var uiState: ComposeUIState - @EnvironmentObject var mastodonController: MastodonController @StateObject private var draftsManager = DraftsManager.shared @State private var draftForDifferentReply: Draft? @@ -112,8 +113,8 @@ struct DraftView: View { } } -struct DraftsView_Previews: PreviewProvider { - static var previews: some View { - DraftsView(currentDraft: Draft(accountID: "")) - } -} +//struct DraftsView_Previews: PreviewProvider { +// static var previews: some View { +// DraftsView(currentDraft: Draft(accountID: "")) +// } +//}