Fixed logout problem #3547 (#3649) (#3927)

* fixed logout problem

fixed logout problem

fixed logout problem

fixed logout problem

fixed logout problem

* added error handling on logout

Co-authored-by: gouri-panda <gouripanda4@gmail.com>
This commit is contained in:
Ashish 2020-09-14 16:47:59 +05:30 committed by GitHub
parent ece085d1d1
commit e2ba80c342
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,7 @@ import com.mapbox.mapboxsdk.Mapbox;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
import io.reactivex.Completable;
import org.acra.ACRA;
import org.acra.annotation.AcraCore;
import org.acra.annotation.AcraDialog;
@ -267,17 +268,18 @@ public class CommonsApplication extends Application {
}
sessionManager.logout()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(() -> {
Timber.d("All accounts have been removed");
clearImageCache();
//TODO: fix preference manager
defaultPrefs.clearAll();
defaultPrefs.putBoolean("firstrun", false);
updateAllDatabases();
logoutListener.onLogoutComplete();
});
.andThen(Completable.fromAction(() ->{
Timber.d("All accounts have been removed");
clearImageCache();
//TODO: fix preference manager
defaultPrefs.clearAll();
defaultPrefs.putBoolean("firstrun", false);
updateAllDatabases();
}
))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(logoutListener::onLogoutComplete, Timber::e);
}
/**