Skip to content

Commit

Permalink
[Fixed] k0shk0sh#2960
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhPatange committed Jan 3, 2021
1 parent fa65150 commit 4aadb7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class LoginPresenter extends BasePresenter<LoginMvp.View> implements Logi
.appendPath("authorize")
.appendQueryParameter("client_id", GithubConfigHelper.getClientId())
.appendQueryParameter("redirect_uri", GithubConfigHelper.getRedirectUrl())
.appendQueryParameter("scope", "user,repo,gist,notifications,read:org")
.appendQueryParameter("scope", "user,repo,gist,notifications,read:org,workflow")
.appendQueryParameter("state", BuildConfig.APPLICATION_ID)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import com.fastaccess.ui.base.mvp.presenter.BasePresenter
*/
class EditRepoFilePresenter : BasePresenter<EditRepoFileMvp.View>(), EditRepoFileMvp.Presenter {

@com.evernote.android.state.State var model: EditRepoFileModel? = null
@com.evernote.android.state.State
var model: EditRepoFileModel? = null
var fileContent: String? = null

var downloadedContent: String? = null
Expand Down Expand Up @@ -42,16 +43,16 @@ class EditRepoFilePresenter : BasePresenter<EditRepoFileMvp.View>(), EditRepoFil
if (!text.isNullOrBlank() && !description.isNullOrBlank() && !filename.isNullOrBlank()) {
model?.let {
val commitModel = CommitRequestModel(description!!, Base64.encodeToString(text!!.toByteArray(), Base64.DEFAULT), it.sha, it.ref)
val observable = RestProvider.getContentService(isEnterprise).updateCreateFile(it.login, it.repoId,
if (it.path.isNullOrBlank()) {
filename!!
} else {
if (it.path!!.endsWith("/")) {
"${it.path}$filename"
} else {
"${it.path}"
}
}, it.ref, commitModel)
val path = if (it.path.isNullOrBlank()) {
filename!!
} else {
if (it.path!!.endsWith("/")) {
"${it.path}$filename"
} else {
"${it.path}"
}
}
val observable = RestProvider.getContentService(isEnterprise).updateCreateFile(it.login, it.repoId, path, it.ref, commitModel)
makeRestCall(observable, { sendToView { it.onSuccessfullyCommitted() } })
}
}
Expand Down

0 comments on commit 4aadb7c

Please sign in to comment.