Plugins: Fix refreshable

Place refreshable in the individual lists instead of in the parent
ZStack as that applies to sheets as well.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2023-04-04 15:07:08 -04:00
parent 29614bc0f8
commit d5ba67503b
2 changed files with 4 additions and 3 deletions

View file

@ -83,6 +83,10 @@ struct PluginAggregateView<P: Plugin, PJ: PluginJson>: View {
.onChange(of: searchText) { _ in
fetchPredicate()
}
// Alternatively, place the sheet in the parent view
.refreshable {
await pluginManager.fetchPluginsFromUrl()
}
.sheet(isPresented: $showPluginOptions) {
PluginInfoView(selectedPlugin: $selectedPlugin)
}

View file

@ -73,9 +73,6 @@ struct PluginsView: View {
.onDisappear {
checkedForPlugins = false
}
.refreshable {
await pluginManager.fetchPluginsFromUrl()
}
.navigationTitle("Plugins")
.searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .always))
.autocorrectionDisabled(!autocorrectSearch)