Fix label listing for users (#1217)

Fixes label listing if trying to change labels for a user-owned repo (not org).

Fixes #1216

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1217
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
qwerty287 2022-11-02 13:51:16 +01:00 committed by M M Arif
parent 4aef17bbe7
commit 8cea886163
1 changed files with 6 additions and 5 deletions

View File

@ -47,10 +47,9 @@ public class LabelsActions {
if (issueLabelsList.size() > 0) { if (issueLabelsList.size() > 0) {
for (int i = 0; i < issueLabelsList.size(); i++) { for (Label label : issueLabelsList) {
currentLabelsIds.add( currentLabelsIds.add(Math.toIntExact(label.getId()));
Math.toIntExact(issueLabelsList.get(i).getId()));
} }
} }
} else { } else {
@ -111,10 +110,10 @@ public class LabelsActions {
@NonNull retrofit2.Response<List<Label>> @NonNull retrofit2.Response<List<Label>>
responseOrg) { responseOrg) {
if (responseOrg.body() != null) { if (responseOrg.isSuccessful()
&& responseOrg.body() != null) {
labelsList.addAll(responseOrg.body()); labelsList.addAll(responseOrg.body());
materialAlertDialogBuilder.show();
} }
if (labelsList.isEmpty()) { if (labelsList.isEmpty()) {
@ -123,6 +122,8 @@ public class LabelsActions {
ctx, ctx,
ctx.getResources() ctx.getResources()
.getString(R.string.noDataFound)); .getString(R.string.noDataFound));
} else {
materialAlertDialogBuilder.show();
} }
labelsBinding.labelsRecyclerView.setAdapter( labelsBinding.labelsRecyclerView.setAdapter(