Minor bugs fixed.

This commit is contained in:
Alex Ning 2022-02-04 11:26:45 +08:00
parent 5713982e8f
commit 101525ae33
2 changed files with 8 additions and 3 deletions

View File

@ -1216,9 +1216,12 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
sortType, APIUtils.getOAuthHeader(mAccessToken)); sortType, APIUtils.getOAuthHeader(mAccessToken));
} }
} }
postAndComments.enqueue(new Callback<String>() { postAndComments.enqueue(new Callback<>() {
@Override @Override
public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) {
if (!isAdded()) {
return;
}
mSwipeRefreshLayout.setRefreshing(false); mSwipeRefreshLayout.setRefreshing(false);
if (response.isSuccessful()) { if (response.isSuccessful()) {
@ -1344,7 +1347,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
@Override @Override
public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) {
showErrorView(subredditId); if (isAdded()) {
showErrorView(subredditId);
}
} }
}); });
} }

View File

@ -99,7 +99,7 @@
<string name="karma_info_user_detail">"Карма: <string name="karma_info_user_detail">"Карма:
%1$d (%2$d + %3$d)"</string> %1$d (%2$d + %3$d)"</string>
<string name="cakeday_info">"День торта: <string name="cakeday_info">"День торта:
%1$d"</string> %1$s"</string>
<string name="since">"Від:"</string> <string name="since">"Від:"</string>
<string name="profile">"Профіль"</string> <string name="profile">"Профіль"</string>
<string name="subscriptions">"Підписки"</string> <string name="subscriptions">"Підписки"</string>