From a8b5764dae8bd202638fecc8a9010a3129022455 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 11 Dec 2023 17:47:18 +0800 Subject: [PATCH] Toggle between add/done buttons when feeds are selected --- .../App/Views/Home/LibraryScanFeedView.swift | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/LibraryScanFeedView.swift b/apple/OmnivoreKit/Sources/App/Views/Home/LibraryScanFeedView.swift index 9e75076af..3c9849a3c 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/LibraryScanFeedView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/LibraryScanFeedView.swift @@ -130,15 +130,23 @@ public struct LibraryScanFeedView: View { } .toolbar { ToolbarItem(placement: .barTrailing) { - Button(action: { - dismiss() - showInLibrarySnackbar("Adding feeds...") - Task { - await viewModel.addFeeds() - } - }, label: { - Text("Done").bold() - }) + if viewModel.selected.count > 0 { + Button(action: { + dismiss() + showInLibrarySnackbar("Adding feeds...") + Task { + await viewModel.addFeeds() + } + }, label: { + Text("Add").bold() + }) + } else { + Button(action: { + dismiss() + }, label: { + Text("Done").bold() + }) + } } } }