Fixing toasty bug. (#412)
Fixing toasty bug. Co-authored-by: opyale <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/412 Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
@ -108,18 +108,23 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
|||||||
|
|
||||||
if(response.isSuccessful()) {
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
assert response.body() != null;
|
||||||
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
tinyDb.putBoolean("repoWatch", false);
|
tinyDb.putBoolean("repoWatch", false);
|
||||||
|
|
||||||
|
if(response.code() != 404) {
|
||||||
|
|
||||||
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
|
@ -101,18 +101,23 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
|||||||
|
|
||||||
if(response.isSuccessful()) {
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
assert response.body() != null;
|
||||||
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
tinyDb.putBoolean("repoWatch", false);
|
tinyDb.putBoolean("repoWatch", false);
|
||||||
|
|
||||||
|
if(response.code() != 404) {
|
||||||
|
|
||||||
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
|
@ -108,18 +108,23 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
|||||||
|
|
||||||
if(response.isSuccessful()) {
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
assert response.body() != null;
|
||||||
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
tinyDb.putBoolean("repoWatch", false);
|
tinyDb.putBoolean("repoWatch", false);
|
||||||
|
|
||||||
|
if(response.code() != 404) {
|
||||||
|
|
||||||
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
|
@ -105,18 +105,23 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
|||||||
|
|
||||||
if(response.isSuccessful()) {
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
assert response.body() != null;
|
||||||
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
tinyDb.putBoolean("repoWatch", false);
|
tinyDb.putBoolean("repoWatch", false);
|
||||||
|
|
||||||
|
if(response.code() != 404) {
|
||||||
|
|
||||||
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
|
@ -105,18 +105,23 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
|||||||
|
|
||||||
if(response.isSuccessful()) {
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
assert response.body() != null;
|
||||||
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
tinyDb.putBoolean("repoWatch", response.body().getSubscribed());
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
tinyDb.putBoolean("repoWatch", false);
|
tinyDb.putBoolean("repoWatch", false);
|
||||||
|
|
||||||
|
if(response.code() != 404) {
|
||||||
|
|
||||||
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
Toasty.info(context, context.getString(R.string.genericApiStatusError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<WatchRepository> call, @NonNull Throwable t) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user