log.Error("GetDeletedBranchByID: %v", err)
ctx.Flash.Error(ctx.Tr("repo.branch.restore_failed", branchName))
return
+ } else if deletedBranch == nil {
+ log.Debug("RestoreBranch: Can't restore branch[%d] '%s', as it does not exist", branchID, branchName)
+ ctx.Flash.Error(ctx.Tr("repo.branch.restore_failed", branchName))
+ return
}
if err := git.Push(ctx, ctx.Repo.Repository.RepoPath(), git.PushOptions{
e.preventDefault();
const $this = $(this);
const redirect = $this.data('redirect');
+ $this.prop('disabled', true);
$.post($this.data('url'), {
_csrf: csrfToken
}).done((data) => {
} else {
window.location.reload();
}
+ }).always(() => {
+ $this.prop('disabled', false);
});
}
// FIXME: this is only used once, and should be replace with `link-action` instead
$('.undo-button').on('click', function () {
const $this = $(this);
+ $this.prop('disabled', true);
$.post($this.data('url'), {
_csrf: csrfToken,
id: $this.data('id')
}).done((data) => {
window.location.href = data.redirect;
+ }).always(() => {
+ $this.prop('disabled', false);
});
});
}