mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-18 10:45:15 +00:00
Fix #1419
This commit is contained in:
parent
518e69d49d
commit
f08c90f8a0
2 changed files with 9 additions and 6 deletions
|
@ -10,7 +10,7 @@ struct StatusEditorMediaView: View {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(CurrentInstance.self) private var currentInstance
|
@Environment(CurrentInstance.self) private var currentInstance
|
||||||
var viewModel: StatusEditorViewModel
|
var viewModel: StatusEditorViewModel
|
||||||
@State private var editingContainer: StatusEditorMediaContainer?
|
@Binding var editingContainer: StatusEditorMediaContainer?
|
||||||
|
|
||||||
@State private var isErrorDisplayed: Bool = false
|
@State private var isErrorDisplayed: Bool = false
|
||||||
|
|
||||||
|
@ -40,10 +40,6 @@ struct StatusEditorMediaView: View {
|
||||||
}
|
}
|
||||||
.padding(.horizontal, .layoutPadding)
|
.padding(.horizontal, .layoutPadding)
|
||||||
}
|
}
|
||||||
.sheet(item: $editingContainer) { container in
|
|
||||||
StatusEditorMediaEditView(viewModel: viewModel, container: container)
|
|
||||||
.preferredColorScheme(theme.selectedScheme == .dark ? .dark : .light)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private func makeVideoAttachement(container: StatusEditorMediaContainer) -> some View {
|
private func makeVideoAttachement(container: StatusEditorMediaContainer) -> some View {
|
||||||
|
|
|
@ -26,6 +26,8 @@ public struct StatusEditorView: View {
|
||||||
|
|
||||||
@State private var isDismissAlertPresented: Bool = false
|
@State private var isDismissAlertPresented: Bool = false
|
||||||
@State private var isLanguageConfirmPresented = false
|
@State private var isLanguageConfirmPresented = false
|
||||||
|
|
||||||
|
@State private var editingContainer: StatusEditorMediaContainer?
|
||||||
|
|
||||||
public init(mode: StatusEditorViewModel.Mode) {
|
public init(mode: StatusEditorViewModel.Mode) {
|
||||||
_viewModel = .init(initialValue: .init(mode: mode))
|
_viewModel = .init(initialValue: .init(mode: mode))
|
||||||
|
@ -47,7 +49,8 @@ public struct StatusEditorView: View {
|
||||||
.placeholder(String(localized: "status.editor.text.placeholder"))
|
.placeholder(String(localized: "status.editor.text.placeholder"))
|
||||||
.setKeyboardType(preferences.isSocialKeyboardEnabled ? .twitter : .default)
|
.setKeyboardType(preferences.isSocialKeyboardEnabled ? .twitter : .default)
|
||||||
.padding(.horizontal, .layoutPadding)
|
.padding(.horizontal, .layoutPadding)
|
||||||
StatusEditorMediaView(viewModel: viewModel)
|
StatusEditorMediaView(viewModel: viewModel,
|
||||||
|
editingContainer: $editingContainer)
|
||||||
if let status = viewModel.embeddedStatus {
|
if let status = viewModel.embeddedStatus {
|
||||||
StatusEmbeddedView(status: status, client: client, routerPath: RouterPath())
|
StatusEmbeddedView(status: status, client: client, routerPath: RouterPath())
|
||||||
.padding(.horizontal, .layoutPadding)
|
.padding(.horizontal, .layoutPadding)
|
||||||
|
@ -166,6 +169,10 @@ public struct StatusEditorView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.sheet(item: $editingContainer) { container in
|
||||||
|
StatusEditorMediaEditView(viewModel: viewModel, container: container)
|
||||||
|
.preferredColorScheme(theme.selectedScheme == .dark ? .dark : .light)
|
||||||
|
}
|
||||||
.interactiveDismissDisabled(viewModel.shouldDisplayDismissWarning)
|
.interactiveDismissDisabled(viewModel.shouldDisplayDismissWarning)
|
||||||
.onChange(of: appAccounts.currentClient) { _, newValue in
|
.onChange(of: appAccounts.currentClient) { _, newValue in
|
||||||
if viewModel.mode.isInShareExtension {
|
if viewModel.mode.isInShareExtension {
|
||||||
|
|
Loading…
Reference in a new issue