From 87d44b1a5a55bb3ce417d60cc4c9e9419e92b866 Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Tue, 30 Jul 2024 10:21:08 +0700 Subject: [PATCH] chore: Check hotfix before build number Since build number only matters if it's an unstable release --- app/src/main/java/yokai/domain/base/models/Version.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/yokai/domain/base/models/Version.kt b/app/src/main/java/yokai/domain/base/models/Version.kt index bb9907c00b..4d5287b623 100644 --- a/app/src/main/java/yokai/domain/base/models/Version.kt +++ b/app/src/main/java/yokai/domain/base/models/Version.kt @@ -26,10 +26,10 @@ data class Version( patch.compareTo(other.patch)).compareTo(0) // if semver is equal, check version stage (release (3) > beta (2) > alpha (1)) if (rt == 0) rt = stage.weight.compareTo(other.stage.weight) - // if stage is also equal, we compare build number - if (rt == 0) rt = build.compareTo(other.build) - // if everything are equal, check if it's a hotfix (1.2.3 vs 1.2.3.1) + // if stage is also equal, check if it's a hotfix (1.2.3 vs 1.2.3.1) if (rt == 0) rt = hotfix.compareTo(other.hotfix) + // if everything are equal, we compare build number. Still only matters on unstable (beta and nightly) releases + if (rt == 0) rt = build.compareTo(other.build) return rt }