From 4cf076b3faf51d44ae636151749b49058326b85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sun, 24 Nov 2024 21:33:36 +0000 Subject: [PATCH] Fix edge case where chart tabs were reset to single value on debug build --- .../freeyourgadget/gadgetbridge/GBApplication.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java index 282041260..9c67cfa73 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java @@ -1853,8 +1853,12 @@ public class GBApplication extends Application { } final String newPrefValue; - if (!StringUtils.isBlank(chartsTabsValue) && !chartsTabsValue.contains("calories")) { - newPrefValue = chartsTabsValue + ",calories"; + if (!StringUtils.isBlank(chartsTabsValue)) { + if (!chartsTabsValue.contains("calories")) { + newPrefValue = chartsTabsValue + ",calories"; + } else { + newPrefValue = chartsTabsValue; + } } else { newPrefValue = "calories"; }