aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ApplicationOnlyAccessTokenAuthenticator.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java
index 19e6d0da..f8da226a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java
@@ -49,7 +49,7 @@ class AccessTokenAuthenticator implements Authenticator {
Account account = mRedditDataRoomDatabase.accountDao().getCurrentAccount();
if (account == null) {
//Anonymous mode
- if (mRedditDataRoomDatabase.accountDao().isAnonymousAccountInserted()) {
+ if (!mRedditDataRoomDatabase.accountDao().isAnonymousAccountInserted()) {
mRedditDataRoomDatabase.accountDao().insert(Account.getAnonymousAccount());
}
String accessTokenFromSharedPreference = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, "");
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ApplicationOnlyAccessTokenAuthenticator.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ApplicationOnlyAccessTokenAuthenticator.java
index 75f0ed13..970b81fd 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ApplicationOnlyAccessTokenAuthenticator.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ApplicationOnlyAccessTokenAuthenticator.java
@@ -46,7 +46,7 @@ class ApplicationOnlyAccessTokenAuthenticator implements Authenticator {
String accessToken = accessTokenHeader.substring(APIUtils.AUTHORIZATION_BASE.length());
synchronized (this) {
- if (mRedditDataRoomDatabase.accountDao().isAnonymousAccountInserted()) {
+ if (!mRedditDataRoomDatabase.accountDao().isAnonymousAccountInserted()) {
mRedditDataRoomDatabase.accountDao().insert(Account.getAnonymousAccount());
}
String accessTokenFromSharedPreference = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, "");