Skip to content
Snippets Groups Projects
Commit 8d96568c authored by jakobsbode's avatar jakobsbode
Browse files

show skip button only in travel intro, if user traveled

parent 16779a17
No related branches found
No related tags found
No related merge requests found
...@@ -107,7 +107,7 @@ class IntroDescriptionViewController: UIViewController, IntroInfoButton { ...@@ -107,7 +107,7 @@ class IntroDescriptionViewController: UIViewController, IntroInfoButton {
if doneAction != nil { if doneAction != nil {
self.navigationItem.setRightBarButton(UIBarButtonItem(title: doneText, style: .plain, target: self, action: #selector(doneTapped(_:))), animated: true) self.navigationItem.setRightBarButton(UIBarButtonItem(title: doneText, style: .plain, target: self, action: #selector(doneTapped(_:))), animated: true)
} }
if skipAction == nil { if skipAction == nil || !(UserManager.loadUserValue(.userTraveled) as? Bool ?? false) {
skipButton.isHidden = true skipButton.isHidden = true
} else { } else {
skipButton.isHidden = false skipButton.isHidden = false
......
...@@ -476,6 +476,7 @@ public class TravelHandler { ...@@ -476,6 +476,7 @@ public class TravelHandler {
//TODO: errorhandling //TODO: errorhandling
} }
describeSecretController.navigationController?.pushViewController(secretController, animated: true) describeSecretController.navigationController?.pushViewController(secretController, animated: true)
UserManager.storeUserValue(true as AnyObject, attribute: .userTraveled)
} }
secretController.navigationItem.hidesBackButton = true secretController.navigationItem.hidesBackButton = true
secretController.doneText = NSLocalizedString("Next", comment: "present next ViewController") secretController.doneText = NSLocalizedString("Next", comment: "present next ViewController")
......
...@@ -22,7 +22,7 @@ import KeychainAccess ...@@ -22,7 +22,7 @@ import KeychainAccess
enum Attribute: Int { enum Attribute: Int {
case accountname, userName, userAddr, userPW, smtpHostname, smtpPort, imapHostname, imapPort, prefEncryption, publicKey, autocryptType, imapConnectionType, imapAuthType, smtpConnectionType, smtpAuthType, sentFolderPath, draftFolderPath, trashFolderPath, inboxFolderPath, archiveFolderPath, nextDeadline/*used for Logging; determines the earliest next time a log is send to the researchers*/, prefSecretKeyID, subjectSalt /*used for Logging; salt for the hashfunction for mail subjects*/, loggingFolderPath case accountname, userName, userAddr, userPW, smtpHostname, smtpPort, imapHostname, imapPort, prefEncryption, publicKey, autocryptType, imapConnectionType, imapAuthType, smtpConnectionType, smtpAuthType, sentFolderPath, draftFolderPath, trashFolderPath, inboxFolderPath, archiveFolderPath, nextDeadline/*used for Logging; determines the earliest next time a log is send to the researchers*/, prefSecretKeyID, subjectSalt /*used for Logging; salt for the hashfunction for mail subjects*/, loggingFolderPath, userTraveled
var defaultValue: AnyObject? { var defaultValue: AnyObject? {
switch self { switch self {
...@@ -44,6 +44,8 @@ enum Attribute: Int { ...@@ -44,6 +44,8 @@ enum Attribute: Int {
return Date(timeIntervalSinceNow: TimeInterval(Logger.loggingInterval)) as AnyObject? return Date(timeIntervalSinceNow: TimeInterval(Logger.loggingInterval)) as AnyObject?
case .loggingFolderPath: //save backendFolderPath here case .loggingFolderPath: //save backendFolderPath here
return "letterbox-study" as AnyObject? return "letterbox-study" as AnyObject?
case .userTraveled:
return false as AnyObject?
default: default:
return nil return nil
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment