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.

Turn an app page's actions off while it removes the app

Țugui Dragoș6314a7af8d4e
diff --git a/Peel/Views/AppDetailView.swift b/Peel/Views/AppDetailView.swift
index eea89156..735ca5bc 100644
--- a/Peel/Views/AppDetailView.swift
+++ b/Peel/Views/AppDetailView.swift
@@ -105,7 +105,8 @@ struct AppDetailView: View {
privacyReset: privacyReset,
isShowingReset: $isShowingReset,
isConfirmingPrivacyReset: $isConfirmingPrivacyReset,
- upgradeOutput: $upgradeOutput
+ upgradeOutput: $upgradeOutput,
+ isRemoving: plan.isRemoving || quitting.isWaiting
)
.listRowSeparator(.hidden)
diff --git a/Peel/Views/AppPageHeader.swift b/Peel/Views/AppPageHeader.swift
index 4f08693f..2d6505d8 100644
--- a/Peel/Views/AppPageHeader.swift
+++ b/Peel/Views/AppPageHeader.swift
@@ -13,6 +13,8 @@ struct AppPageHeader: View {
@Binding var isShowingReset: Bool
@Binding var isConfirmingPrivacyReset: Bool
@Binding var upgradeOutput: HomebrewLibrary.CommandResult?
+ /// True while the page removes the app or waits for it to quit first, when nothing else is started from here.
+ let isRemoving: Bool
@State private var quitting = QuitBeforeRemoving()
var body: some View {
@@ -67,6 +69,7 @@ struct AppPageHeader: View {
}
moreMenu
}
+ .disabled(isRemoving)
if let upgrade = library.upgrade(of: plan.app) {
outcome(of: upgrade)
} else if let source = updateSource, waitingVersion != nil {