mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08: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;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import org.gitnex.tea4j.v2.models.Comment;
|
||||
@ -112,7 +113,10 @@ public class IssueActions {
|
||||
|
||||
IssueDetailActivity.singleIssueUpdate = true;
|
||||
((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) {
|
||||
|
@ -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
|
||||
});
|
||||
CommitDetailFragment.this.binding.diffFiles.addHeaderView(binding.getRoot());
|
||||
assert response.body() != null;
|
||||
Commit commitsModel = response.body();
|
||||
if(commitsModel == null) {
|
||||
onFailure(call, new Throwable());
|
||||
return;
|
||||
}
|
||||
String[] commitMessageParts = commitsModel.getCommit().getMessage().split("(\r\n|\n)", 2);
|
||||
|
||||
if(commitMessageParts.length > 1 && !commitMessageParts[1].trim().isEmpty()) {
|
||||
|
@ -263,13 +263,19 @@ public class RepoInfoFragment extends Fragment {
|
||||
switch(response.code()) {
|
||||
|
||||
case 200:
|
||||
try {
|
||||
assert response.body() != null;
|
||||
Markdown.render(ctx, response.body().string(), binding.repoFileContents, repository);
|
||||
}
|
||||
catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
assert response.body() != null;
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Markdown.render(ctx, response.body().string(), binding.repoFileContents, repository);
|
||||
}
|
||||
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;
|
||||
|
||||
case 401:
|
||||
|
Loading…
Reference in New Issue
Block a user