Skip to content

Commit

Permalink
Merge pull request #9960 from Expensify/justice-fix-android-badge
Browse files Browse the repository at this point in the history
Android - Chat - Badge "stg" is missing
  • Loading branch information
Luke9389 authored Jul 19, 2022
2 parents 4bbfc43 + f676775 commit 6369e8e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/libs/Environment/betaChecker/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ function isBetaBuild() {
fetch(CONST.PLAY_STORE_URL)
.then(res => res.text())
.then((text) => {
const productionVersionMatch = text.match(/<span[^>]+class="htlgb"[^>]*>([-\d.]+)<\/span>/);
const productionVersionSearch = text.match(/\[\[\["\d+\.\d+\.\d+/);
if (!productionVersionSearch) {
resolve(false);
}

const productionVersion = productionVersionSearch[0].match(/\d+\.\d+\.\d+/);

// If we have a match for the production version regex and the current version is not the same
// as the production version, we are on a beta build
const isBeta = productionVersionMatch && productionVersionMatch[1].trim() !== version;
const isBeta = productionVersion && productionVersionSearch[0].trim() !== version;
resolve(isBeta);
})
.catch(() => {
Expand Down

0 comments on commit 6369e8e

Please sign in to comment.