]> git.ktnx.net Git - mobile-ledger.git/commitdiff
Data.setCurrentProfile: use setValue() instead of postValue()
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 20 May 2020 20:54:16 +0000 (23:54 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 20 May 2020 20:54:16 +0000 (23:54 +0300)
this is used in places that need the change now, not at some later point

for example, on profile change, which triggers activity recreation/theme
change

app/src/main/java/net/ktnx/mobileledger/model/Data.java

index 0539c136706e54a2bbf2640b2ca51442fdbc068e..0bdbb1a229faa104af945fdab812ba4ad078ec45 100644 (file)
@@ -76,7 +76,7 @@ public final class Data {
     public static void setCurrentProfile(MobileLedgerProfile newProfile) {
         MLDB.setOption(MLDB.OPT_PROFILE_UUID, (newProfile == null) ? null : newProfile.getUuid());
         stopTransactionsRetrieval();
     public static void setCurrentProfile(MobileLedgerProfile newProfile) {
         MLDB.setOption(MLDB.OPT_PROFILE_UUID, (newProfile == null) ? null : newProfile.getUuid());
         stopTransactionsRetrieval();
-        profile.postValue(newProfile);
+        profile.setValue(newProfile);
     }
     public static int getProfileIndex(MobileLedgerProfile profile) {
         try (LockHolder ignored = profilesLocker.lockForReading()) {
     }
     public static int getProfileIndex(MobileLedgerProfile profile) {
         try (LockHolder ignored = profilesLocker.lockForReading()) {