Let accounts be set inactive without signing them out

An inactive account keeps its credential and syncs like a rename, but
drops out of every picker and cannot be used until activated again.
Deactivating the selected account switches to the local context as a
published choice, so other devices follow instead of falling back.
This commit is contained in:
Arkadiusz Fal
2026-09-19 23:58:24 +02:00
parent 01ff78aaa6
commit 794b2b0181
10 changed files with 160 additions and 7 deletions

View File

@@ -359,6 +359,21 @@ struct AccountsListView: View {
Label(String(localized: "accounts.rename"), systemImage: "pencil")
}
// Not offered on an orphan: with no source there is nothing an active
// account could do that an inactive one cannot.
if instance != nil {
Button {
appEnvironment?.accountsManager.updateIsActive(!account.isActive, for: account.id)
} label: {
Label(
String(localized: account.isActive ? "accounts.deactivate" : "accounts.activate"),
systemImage: account.isActive
? "person.crop.circle.badge.minus"
: "person.crop.circle.badge.checkmark"
)
}
}
Button(role: .destructive) {
pendingRemoval = PendingAccountRemoval(
id: account.id,