Refactor after the CR

This commit is contained in:
Maciej Gomółka
2026-01-21 14:08:24 +01:00
parent 4eb0523ff9
commit f4d57a4dfb
4 changed files with 16 additions and 5 deletions
@@ -130,7 +130,7 @@ struct IntroductionViewModifier: ViewModifier {
}
private func whatsNewScreenDismissed() {
dependencies.userDefaults[.lastWhatsNewVersion] = dependencies.bundle.bundleShortVersion
dependencies.userDefaults[.lastWhatsNewVersion] = NewFeatureIntroduction.whatsNewVersion
Task {
await presentAppropriateIntroductoryView()
@@ -170,7 +170,6 @@ extension IntroductionViewModifier {
struct Dependencies {
let notificationAuthorizationStore: NotificationAuthorizationStore
let userDefaults: UserDefaults
let bundle: Bundle
}
enum IntroductionProgress: Equatable {
@@ -375,7 +375,7 @@ struct MessageDetailsView: View {
InfoRowWithLearnMore(
title: trackers.loadedValue?.fullTitle ?? .randomPlaceholder(length: 24),
iconView: {
Image(DS.Icon.icShield2CheckFilled)
DS.Icon.icShield2CheckFilled.image
.size(.footnote)
},
iconColor: DS.Color.Icon.norm,
@@ -112,8 +112,7 @@ struct HomeScreen: View {
.introductionViews(
dependencies: .init(
notificationAuthorizationStore: notificationAuthorizationStore,
userDefaults: appContext.userDefaults,
bundle: .main
userDefaults: appContext.userDefaults
)
)
.environmentObject(composerCoordinator)
@@ -25,6 +25,19 @@ struct NewFeatureIntroduction: Hashable {
}
extension NewFeatureIntroduction {
/// This value should be bumped whenever there's a new "What's New" bundle to show to users.
/// The app compares this value with a previously stored version to determine if the screen should be presented.
/// If the values differ, the "What's New" screen will be shown.
///
/// After the screen is dismissed, the stored value is updated to match this version,
/// preventing the screen from appearing again until this value is changed.
static let whatsNewVersion = "7.7.0".notLocalized
/// Contains an array of features to be displayed when showing the "What's New" screen to users.
/// Each feature includes a name, description, and icon that will be presented in the UI.
///
/// Update this array when preparing a new "What's New" bundle, and remember to bump `whatsNewVersion`
/// to trigger the screen presentation.
static var whatsNew: [Self] {
[
.init(