mirror of
https://github.com/Docile-Alligator/Infinity-For-Reddit.git
synced 2026-02-26 19:36:06 +00:00
Fix inserting the anonymous account even when it was already inserted.
This commit is contained in:
@ -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, "");
|
||||
|
||||
@ -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, "");
|
||||
|
||||
Reference in New Issue
Block a user