mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-26 02:48:23 +01:00
Minor code fixes
This commit is contained in:
parent
d926fabe09
commit
2ed15f3d5c
@ -64,7 +64,6 @@ import eu.toldi.infinityforlemmy.utils.Utils;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public class InboxActivity extends BaseActivity implements ActivityToolbarInterface, RecyclerViewContentScrollingInterface {
|
||||
|
||||
@ -93,9 +92,6 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf
|
||||
@Named("base")
|
||||
RetrofitHolder mRetrofit;
|
||||
|
||||
@Inject
|
||||
@Named("oauth")
|
||||
Retrofit mOauthRetrofit;
|
||||
@Inject
|
||||
RedditDataRoomDatabase mRedditDataRoomDatabase;
|
||||
@Inject
|
||||
@ -307,7 +303,7 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf
|
||||
} else if (item.getItemId() == R.id.action_read_all_messages_inbox_activity) {
|
||||
if (mAccessToken != null) {
|
||||
Toast.makeText(this, R.string.please_wait, Toast.LENGTH_SHORT).show();
|
||||
mOauthRetrofit.create(RedditAPI.class).readAllMessages(APIUtils.getOAuthHeader(mAccessToken))
|
||||
mRetrofit.getRetrofit().create(RedditAPI.class).readAllMessages(APIUtils.getOAuthHeader(mAccessToken))
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) {
|
||||
|
@ -209,6 +209,7 @@ public class LoginActivity extends BaseActivity {
|
||||
|
||||
try {
|
||||
String errorBody = response.errorBody().string();
|
||||
Log.e("LoginActivity", "Error body: " + errorBody.trim());
|
||||
JSONObject responseObject = new JSONObject(errorBody.trim());
|
||||
if (responseObject.has("error")) {
|
||||
if (responseObject.getString("error").equals("incorrect_login")) {
|
||||
@ -225,7 +226,7 @@ public class LoginActivity extends BaseActivity {
|
||||
Toast.makeText(LoginActivity.this, R.string.cannot_fetch_user_info, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
Log.e("LoginActivity", "Failed to get access token: " + response.code() + " " + response.message() + " " + response.errorBody());
|
||||
Log.e("LoginActivity", "Failed to get access token: " + response.code() + " " + response.message());
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user