Fix edit comment draft (#661)

Fix edit comment draft

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/661
This commit is contained in:
M M Arif 2020-08-24 12:03:16 +02:00
parent 28a23d30f8
commit 00eb9c9135
1 changed files with 8 additions and 3 deletions

View File

@ -104,7 +104,12 @@ public class ReplyToIssueActivity extends BaseActivity {
}
else {
draftIdOnCreate = returnDraftId();
if(getIntent().getStringExtra("commentBody") != null) {
draftIdOnCreate = returnDraftId(getIntent().getStringExtra("commentBody"));
}
else {
draftIdOnCreate = returnDraftId("");
}
}
replyButton = findViewById(R.id.replyButton);
@ -216,7 +221,7 @@ public class ReplyToIssueActivity extends BaseActivity {
}
private long returnDraftId() {
private long returnDraftId(String draftText) {
TinyDB tinyDb = new TinyDB(getApplicationContext());
@ -226,7 +231,7 @@ public class ReplyToIssueActivity extends BaseActivity {
DraftsApi draftsApi = new DraftsApi(appCtx);
return draftsApi.insertDraft(repositoryId, currentActiveAccountId, issueNumber, "", StaticGlobalVariables.draftTypeComment, "");
return draftsApi.insertDraft(repositoryId, currentActiveAccountId, issueNumber, draftText, StaticGlobalVariables.draftTypeComment, "");
}