Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not show change log when it is empty #5297

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading