Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Keep Rescan and Edit… steady through a quick action on a job

Țugui Dragoș6f07e81b3541
diff --git a/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift b/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift
index ba10c6e7..60041ed5 100644
--- a/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift
+++ b/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift
@@ -91,9 +91,12 @@ struct BackgroundItemDetailView: View {
.textSelection(.enabled)
.help(Text(verbatim: plist.fullPath))
if item.canBeEdited {
- Button("Edit…") { isEditing = true }
- .controlSize(.small)
- .disabled(isBusy || !history.mayMove)
+ // On the busy timing, so a quick action doesn't flash it.
+ BusyShown(isBusy: isBusy) { isShown in
+ Button("Edit…") { isEditing = true }
+ .controlSize(.small)
+ .disabled(isShown || !history.mayMove)
+ }
}
if finderURL == plist {
ShowInFinderButton(url: plist)
diff --git a/Peel/Views/BackgroundItems/BackgroundItemList.swift b/Peel/Views/BackgroundItems/BackgroundItemList.swift
index bd206ca3..0d6545ca 100644
--- a/Peel/Views/BackgroundItems/BackgroundItemList.swift
+++ b/Peel/Views/BackgroundItems/BackgroundItemList.swift
@@ -56,12 +56,15 @@ struct BackgroundItemList: View {
)
.toolbar {
ToolbarItem {
- RescanButton(
- isRunning: $isRescanning,
- isDisabled: !library.hasLoaded || !backgroundItems.runningActionItemIDs.isEmpty,
- scan: backgroundItems.scanRun
- ) {
- await backgroundItems.refresh(installedApps: library.apps)
+ // Off during a job's action on the busy timing, so a quick one doesn't flash it.
+ BusyShown(isBusy: !backgroundItems.runningActionItemIDs.isEmpty) { isActing in
+ RescanButton(
+ isRunning: $isRescanning,
+ isDisabled: !library.hasLoaded || isActing,
+ scan: backgroundItems.scanRun
+ ) {
+ await backgroundItems.refresh(installedApps: library.apps)
+ }
}
}
}