diff --git a/Signal/src/ViewControllers/ExperienceUpgradesPageViewController.swift b/Signal/src/ViewControllers/ExperienceUpgradesPageViewController.swift index 54291296f..71bd77d56 100644 --- a/Signal/src/ViewControllers/ExperienceUpgradesPageViewController.swift +++ b/Signal/src/ViewControllers/ExperienceUpgradesPageViewController.swift @@ -229,6 +229,10 @@ private class IntroductingTypingIndicatorsExperienceUpgradeViewController: Exper var primaryButtonAction: ((UIButton) -> Void)? + var typingIndicators: TypingIndicators { + return SSKEnvironment.shared.typingIndicators + } + override func loadView() { self.view = UIView.container() @@ -270,21 +274,10 @@ private class IntroductingTypingIndicatorsExperienceUpgradeViewController: Exper view.addSubview(imageView) imageView.contentMode = .scaleAspectFit - let buttonTitle = NSLocalizedString("UPGRADE_EXPERIENCE_INTRODUCING_TYPING_INDICATOR_PRIVACY_SETTINGS", comment: "button label shown one time, after upgrade") + let buttonTitle = NSLocalizedString("UPGRADE_EXPERIENCE_ENABLE_TYPING_INDICATOR_BUTTON", comment: "button label shown one time, after upgrade") let button = addPrimaryButton(title: buttonTitle) { _ in - // dismiss the modally presented view controller, then proceed. - self.experienceUpgradesPageViewController.dismiss(animated: true) { - guard let fromViewController = UIApplication.shared.frontmostViewController as? HomeViewController else { - owsFailDebug("unexpected frontmostViewController: \(String(describing: UIApplication.shared.frontmostViewController))") - return - } - - // Construct the "settings" view & push the "privacy settings" view. - let navigationController = AppSettingsViewController.inModalNavigationController() - navigationController.pushViewController(PrivacySettingsTableViewController(), animated: false) - - fromViewController.present(navigationController, animated: true) - } + self.typingIndicators.setTypingIndicatorsEnabled(value: true) + self.experienceUpgradesPageViewController.dismiss(animated: true) } let bottomSpacer = UIView() @@ -665,7 +658,7 @@ public class ExperienceUpgradesPageViewController: OWSViewController, UIPageView // Dismiss button let dismissButton = UIButton() view.addSubview(dismissButton) - dismissButton.setTitle(CommonStrings.dismissButton, for: .normal) + dismissButton.setTitle(NSLocalizedString("EXPERIENCE_UPGRADE_DISMISS_BUTTON", comment: "Button to dismiss/ignore the one time splash screen that appears after upgrading"), for: .normal) dismissButton.setTitleColor(UIColor.ows_signalBrandBlue, for: .normal) dismissButton.isUserInteractionEnabled = true dismissButton.addTarget(self, action: #selector(didTapDismissButton), for: .touchUpInside) diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index ad3d5bd83..a641ce074 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -912,6 +912,9 @@ /* Format string for 'unregistered user' error. Embeds {{the unregistered user's name or signal id}}. */ "ERROR_UNREGISTERED_USER_FORMAT" = "Unregistered User: %@"; +/* Button to dismiss/ignore the one time splash screen that appears after upgrading */ +"EXPERIENCE_UPGRADE_DISMISS_BUTTON" = "Not Now"; + /* action sheet header when re-sending message which failed because of too many attempts */ "FAILED_SENDING_BECAUSE_RATE_LIMIT" = "Too many failures with this contact. Please try again later."; @@ -2285,6 +2288,9 @@ /* Header for upgrade experience */ "UPGRADE_EXPERIENCE_CALLKIT_TITLE" = "Just Swipe to Answer"; +/* button label shown one time, after upgrade */ +"UPGRADE_EXPERIENCE_ENABLE_TYPING_INDICATOR_BUTTON" = "Turn On Typing Indicators"; + /* Description for notification audio customization */ "UPGRADE_EXPERIENCE_INTRODUCING_NOTIFICATION_AUDIO_DESCRIPTION" = "You can now choose default and per-conversation notification sounds, and calls will respect the ringtone you've chosen for each system contact."; @@ -2312,9 +2318,6 @@ /* Header for upgrade experience */ "UPGRADE_EXPERIENCE_INTRODUCING_READ_RECEIPTS_TITLE" = "Introducing Read Receipts"; -/* button label shown one time, after upgrade */ -"UPGRADE_EXPERIENCE_INTRODUCING_TYPING_INDICATOR_PRIVACY_SETTINGS" = "Enable typing indicators in your privacy settings."; - /* Body text for upgrading users */ "UPGRADE_EXPERIENCE_INTRODUCING_TYPING_INDICATORS_DESCRIPTION" = "Now you can optionally see and share when messages are being typed."; diff --git a/SignalServiceKit/src/Util/TypingIndicators.swift b/SignalServiceKit/src/Util/TypingIndicators.swift index 4e34f935b..be57a61e3 100644 --- a/SignalServiceKit/src/Util/TypingIndicators.swift +++ b/SignalServiceKit/src/Util/TypingIndicators.swift @@ -82,7 +82,7 @@ public class TypingIndicatorsImpl: NSObject, TypingIndicators { @objc public func setTypingIndicatorsEnabled(value: Bool) { AssertIsOnMainThread() - + Logger.info("\(_areTypingIndicatorsEnabled) -> \(value)") _areTypingIndicatorsEnabled = value primaryStorage.dbReadWriteConnection.setBool(value, forKey: kDatabaseKey_TypingIndicatorsEnabled, inCollection: kDatabaseCollection)