-
-
Notifications
You must be signed in to change notification settings - Fork 37
Show purchase status in settings #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
| } 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"))) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| } | ||
iammajid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
There was a problem hiding this comment.
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?