From 8c93300d3fa64f93b73ef9213c27c89e9e69789d Mon Sep 17 00:00:00 2001 From: Mark Raynsford Date: Tue, 12 Nov 2024 19:15:28 +0000 Subject: [PATCH] The VCS commit string is already a [0,7] substring (PP-1895). --- .../simplified/ui/settings/SettingsMainFragment2.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/simplified-ui-settings/src/main/java/org/nypl/simplified/ui/settings/SettingsMainFragment2.kt b/simplified-ui-settings/src/main/java/org/nypl/simplified/ui/settings/SettingsMainFragment2.kt index c0871e68d..6fb7d15a3 100644 --- a/simplified-ui-settings/src/main/java/org/nypl/simplified/ui/settings/SettingsMainFragment2.kt +++ b/simplified-ui-settings/src/main/java/org/nypl/simplified/ui/settings/SettingsMainFragment2.kt @@ -215,13 +215,16 @@ class SettingsMainFragment2 : Fragment() { private fun formatVersion(): String { return try { - val context = this.requireContext() - val pkgManager = context.packageManager - val pkgInfo = pkgManager.getPackageInfo(context.packageName, 0) + val context = + this.requireContext() + val pkgManager = + context.packageManager + val pkgInfo = + pkgManager.getPackageInfo(context.packageName, 0) val versionName = SettingsModel.buildConfig.simplifiedVersion val commit = - SettingsModel.buildConfig.vcsCommit.substring(IntRange(0, 7)) + SettingsModel.buildConfig.vcsCommit "Palace $versionName (${pkgInfo.versionCode}) [$commit]" } catch (e: Throwable) {