Skip to content
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)
} 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")))
}
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