Skip to content

Commit

Permalink
Merge branch 'stop-showing-the-changelog-to-users-when-it-is-empty-io…
Browse files Browse the repository at this point in the history
…s-346'
  • Loading branch information
buggmagnet committed Oct 17, 2023
2 parents 9ea790f + d903827 commit 391268b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ios/MullvadVPN/Coordinators/ApplicationCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ final class ApplicationCoordinator: Coordinator, Presenting, RootContainerViewCo
}

// Change log can be presented simultaneously with other routes.
if !appPreferences.isSeenLatestChanges {
if !appPreferences.hasSeenLastChanges {
routes.append(.changelog)
}

Expand Down Expand Up @@ -995,12 +995,13 @@ extension DeviceState {
}

fileprivate extension AppPreferencesDataSource {
var isSeenLatestChanges: Bool {
self.lastSeenChangeLogVersion == Bundle.main.shortVersion
var hasSeenLastChanges: Bool {
!ChangeLogInteractor().hasNewChanges ||
(lastSeenChangeLogVersion == Bundle.main.shortVersion)
}

mutating func markChangeLogSeen() {
self.lastSeenChangeLogVersion = Bundle.main.shortVersion
lastSeenChangeLogVersion = Bundle.main.shortVersion
}

// swiftlint:disable:next file_length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import MullvadLogging
final class ChangeLogInteractor {
private let logger = Logger(label: "ChangeLogInteractor")
private var items: [String] = []

var hasNewChanges: Bool {
!items.isEmpty
}

var viewModel: ChangeLogViewModel {
return ChangeLogViewModel(
body: items
Expand Down

0 comments on commit 391268b

Please sign in to comment.