mirror of
https://codeberg.org/gitnex/GitNex
synced 2025-01-28 18:19:33 +01:00
Fix bugs (#1154)
- fix some bugs (see discord) Closes https://codeberg.org/gitnex/GitNex/issues/1153 Co-authored-by: qwerty287 <ndev@web.de> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1154 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org> Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
parent
8975d5c7ca
commit
f75fad2bea
@ -1,5 +1,6 @@
|
|||||||
package org.mian.gitnex.actions;
|
package org.mian.gitnex.actions;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import org.gitnex.tea4j.v2.models.Comment;
|
import org.gitnex.tea4j.v2.models.Comment;
|
||||||
@ -112,7 +113,10 @@ public class IssueActions {
|
|||||||
|
|
||||||
IssueDetailActivity.singleIssueUpdate = true;
|
IssueDetailActivity.singleIssueUpdate = true;
|
||||||
((IssueDetailActivity) ctx).onResume();
|
((IssueDetailActivity) ctx).onResume();
|
||||||
RepoDetailActivity.updateRepo = true;
|
if(((Activity) ctx).getIntent().getStringExtra("openedFromLink") == null ||
|
||||||
|
!((Activity) ctx).getIntent().getStringExtra("openedFromLink").equals("true")) {
|
||||||
|
RepoDetailActivity.updateRepo = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(response.code() == 401) {
|
else if(response.code() == 401) {
|
||||||
|
@ -146,8 +146,11 @@ public class CommitDetailFragment extends Fragment {
|
|||||||
// we need a ClickListener here to prevent that the ItemClickListener of the diffFiles ListView handles clicks for the header
|
// we need a ClickListener here to prevent that the ItemClickListener of the diffFiles ListView handles clicks for the header
|
||||||
});
|
});
|
||||||
CommitDetailFragment.this.binding.diffFiles.addHeaderView(binding.getRoot());
|
CommitDetailFragment.this.binding.diffFiles.addHeaderView(binding.getRoot());
|
||||||
assert response.body() != null;
|
|
||||||
Commit commitsModel = response.body();
|
Commit commitsModel = response.body();
|
||||||
|
if(commitsModel == null) {
|
||||||
|
onFailure(call, new Throwable());
|
||||||
|
return;
|
||||||
|
}
|
||||||
String[] commitMessageParts = commitsModel.getCommit().getMessage().split("(\r\n|\n)", 2);
|
String[] commitMessageParts = commitsModel.getCommit().getMessage().split("(\r\n|\n)", 2);
|
||||||
|
|
||||||
if(commitMessageParts.length > 1 && !commitMessageParts[1].trim().isEmpty()) {
|
if(commitMessageParts.length > 1 && !commitMessageParts[1].trim().isEmpty()) {
|
||||||
|
@ -263,13 +263,19 @@ public class RepoInfoFragment extends Fragment {
|
|||||||
switch(response.code()) {
|
switch(response.code()) {
|
||||||
|
|
||||||
case 200:
|
case 200:
|
||||||
try {
|
assert response.body() != null;
|
||||||
assert response.body() != null;
|
new Thread(() -> {
|
||||||
Markdown.render(ctx, response.body().string(), binding.repoFileContents, repository);
|
try {
|
||||||
}
|
Markdown.render(ctx, response.body().string(), binding.repoFileContents, repository);
|
||||||
catch(IOException e) {
|
}
|
||||||
e.printStackTrace();
|
catch(IOException e) {
|
||||||
}
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
Toasty.error(ctx, ctx.getString(R.string.genericError));
|
||||||
|
binding.fileContentsFrameHeader.setVisibility(View.GONE);
|
||||||
|
binding.fileContentsFrame.setVisibility(View.GONE);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 401:
|
case 401:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user