mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-16 20:26:37 +00:00
Fix #1767
This commit is contained in:
parent
3eb373550e
commit
f04f5c701c
1 changed files with 31 additions and 9 deletions
|
@ -137,16 +137,24 @@ struct StatusEditorAccessoryView: View {
|
|||
})
|
||||
.sheet(isPresented: $isGIFPickerPresented, content: {
|
||||
#if !os(visionOS)
|
||||
GifPickerView { url in
|
||||
GPHCache.shared.downloadAssetData(url) { data, _ in
|
||||
guard let data else { return }
|
||||
viewModel.processGIFData(data: data)
|
||||
#if targetEnvironment(macCatalyst)
|
||||
NavigationStack {
|
||||
giphyView
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .topBarLeading) {
|
||||
Button {
|
||||
isGIFPickerPresented = false
|
||||
} label: {
|
||||
Image(systemName: "xmark.circle")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
isGIFPickerPresented = false
|
||||
} onShouldDismissGifPicker: {
|
||||
isGIFPickerPresented = false
|
||||
}
|
||||
.presentationDetents([.medium, .large])
|
||||
.presentationDetents([.medium, .large])
|
||||
#else
|
||||
giphyView
|
||||
.presentationDetents([.medium, .large])
|
||||
#endif
|
||||
#else
|
||||
EmptyView()
|
||||
#endif
|
||||
|
@ -258,6 +266,20 @@ struct StatusEditorAccessoryView: View {
|
|||
|
||||
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 {
|
||||
DraftsListView(selectedDraft: .init(get: {
|
||||
|
|
Loading…
Reference in a new issue