Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Cryptomator/Settings/SettingsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ class SettingsViewModel: TableViewModel<SettingsSection> {
}

private var aboutSectionElements: [TableViewCellViewModel] {
var elements = [ButtonCellViewModel.createDisclosureButton(action: SettingsButtonAction.showAbout, title: LocalizedString.getValue("settings.aboutCryptomator"))]
var elements: [TableViewCellViewModel] = [ButtonCellViewModel.createDisclosureButton(action: SettingsButtonAction.showAbout, title: LocalizedString.getValue("settings.aboutCryptomator"))]

if cryptomatorSettings.hasRunningSubscription {
elements.append(.init(action: .showManageSubscriptions, title: LocalizedString.getValue("settings.manageSubscriptions")))
elements.append(.init(action: .restorePurchase, title: LocalizedString.getValue("purchase.restorePurchase.button")))
} else if !cryptomatorSettings.fullVersionUnlocked {
elements.append(ButtonCellViewModel<SettingsButtonAction>(action: .showManageSubscriptions, title: LocalizedString.getValue("settings.manageSubscriptions")))
} else if cryptomatorSettings.fullVersionUnlocked {
let statusCell = BindableTableViewCellViewModel(
title: LocalizedString.getValue("settings.fullVersionStatus"),
selectionStyle: .none,
accessoryType: .checkmark
)
elements.append(statusCell)
Comment on lines +79 to +84
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's think about an alternative here. At the moment, it looks like some "boolean" setting that you can turn on or off. But not only that, it also looks like a button that you can tap.

My suggestion is to not use a table cell at all. How about a footer for this section?

} else {
elements.append(ButtonCellViewModel.createDisclosureButton(action: SettingsButtonAction.showUnlockFullVersion, title: LocalizedString.getValue("settings.unlockFullVersion")))
elements.append(ButtonCellViewModel<SettingsButtonAction>(action: .restorePurchase, title: LocalizedString.getValue("purchase.restorePurchase.button")))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never really paid attention to this "restore purchase" button before, but I think we should remove it completely from this screen. At the moment, it doesn't give the user any useful feedback. In the purchase screen, it works differently and shows some alert.

Before your change, it was only visible when there was a running subscription. I still don't know why this would be necessary in that case. Or if removing this button feels too risky, revert it to how it was before.

}
return elements
}
Expand Down
1 change: 1 addition & 0 deletions SharedResources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
"settings.sendLogFile" = "Send Log File";
"settings.shortcutsGuide" = "Shortcuts Guide";
"settings.unlockFullVersion" = "Unlock Full Version";
"settings.fullVersionStatus" = "Full Version";

"sharePoint.enterURL.title" = "Enter SharePoint URL";
"sharePoint.enterURL.placeholder" = "SharePoint Site URL";
Expand Down
Loading