mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-27 12:59:17 +01:00
Fix #1767
This commit is contained in:
parent
3eb373550e
commit
f04f5c701c
@ -137,16 +137,24 @@ struct StatusEditorAccessoryView: View {
|
|||||||
})
|
})
|
||||||
.sheet(isPresented: $isGIFPickerPresented, content: {
|
.sheet(isPresented: $isGIFPickerPresented, content: {
|
||||||
#if !os(visionOS)
|
#if !os(visionOS)
|
||||||
GifPickerView { url in
|
#if targetEnvironment(macCatalyst)
|
||||||
GPHCache.shared.downloadAssetData(url) { data, _ in
|
NavigationStack {
|
||||||
guard let data else { return }
|
giphyView
|
||||||
viewModel.processGIFData(data: data)
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .topBarLeading) {
|
||||||
|
Button {
|
||||||
|
isGIFPickerPresented = false
|
||||||
|
} label: {
|
||||||
|
Image(systemName: "xmark.circle")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
isGIFPickerPresented = false
|
.presentationDetents([.medium, .large])
|
||||||
} onShouldDismissGifPicker: {
|
#else
|
||||||
isGIFPickerPresented = false
|
giphyView
|
||||||
}
|
.presentationDetents([.medium, .large])
|
||||||
.presentationDetents([.medium, .large])
|
#endif
|
||||||
#else
|
#else
|
||||||
EmptyView()
|
EmptyView()
|
||||||
#endif
|
#endif
|
||||||
@ -258,6 +266,20 @@ struct StatusEditorAccessoryView: View {
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
|
private var giphyView: some View {
|
||||||
|
@Bindable var viewModel = focusedSEVM
|
||||||
|
GifPickerView { url in
|
||||||
|
GPHCache.shared.downloadAssetData(url) { data, _ in
|
||||||
|
guard let data else { return }
|
||||||
|
viewModel.processGIFData(data: data)
|
||||||
|
}
|
||||||
|
isGIFPickerPresented = false
|
||||||
|
} onShouldDismissGifPicker: {
|
||||||
|
isGIFPickerPresented = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var draftsListView: some View {
|
private var draftsListView: some View {
|
||||||
DraftsListView(selectedDraft: .init(get: {
|
DraftsListView(selectedDraft: .init(get: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user