1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-11 05:55:29 +00:00

Fix context popup error (#17398)

* Fix context popup error
This commit is contained in:
wxiaoguang
2021-10-22 22:34:01 +08:00
committed by GitHub
parent 870f5fbc41
commit 406bd3780e
3 changed files with 29 additions and 2 deletions

View File

@ -57,3 +57,9 @@ export function mqBinarySearch(feature, minValue, maxValue, step, unit) {
}
return mqBinarySearch(feature, minValue, mid - step, step, unit); // feature is < mid
}
export function parseIssueHref(href) {
const path = (href || '').replace(/[#?].*$/, '');
const [_, owner, repo, type, index] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
return {owner, repo, type, index};
}