diff options
Diffstat (limited to 'android/app/src/main')
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/ChangelogRepository.kt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/ChangelogRepository.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/ChangelogRepository.kt index 768423e01a..fcc07693c8 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/ChangelogRepository.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/ChangelogRepository.kt @@ -6,7 +6,6 @@ import net.mullvad.mullvadvpn.util.trimAll private const val MISSING_VERSION_CODE = -1 private const val NEWLINE_CHAR = '\n' -private const val SPACE_STRING = " " private const val BULLET_POINT_CHAR = '-' private const val LAST_SHOWED_CHANGELOG_VERSION_CODE = "last_showed_changelog_version_code" @@ -22,9 +21,9 @@ class ChangelogRepository( preferences.edit().putInt(LAST_SHOWED_CHANGELOG_VERSION_CODE, versionCode).apply() fun getLastVersionChanges(): List<String> = - dataProvider - .getChangelog() - .split(BULLET_POINT_CHAR) - .map { it.split(NEWLINE_CHAR).trimAll().joinToString(SPACE_STRING).trim() } + // Prepend with a new line char so each entry consists of NEWLINE_CHAR + BULLET_POINT_CHAR + (NEWLINE_CHAR + dataProvider.getChangelog()) + .split(NEWLINE_CHAR.toString() + BULLET_POINT_CHAR) + .trimAll() .filter { it.isNotEmpty() } } |
