mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: preserve search params for pr link
This commit is contained in:
parent
184a91875a
commit
e4a9277d12
2 changed files with 4 additions and 2 deletions
|
|
@ -95,7 +95,9 @@ export async function getPullPageDocument(
|
|||
repoName: string,
|
||||
pullId: string,
|
||||
): Promise<Document> {
|
||||
const url = `https://${window.location.host}/${userName}/${repoName}/pull/${pullId}/files?_pjax=%23js-repo-pjax-container`
|
||||
const search = new URLSearchParams(window.location.search)
|
||||
search.set('_pjax', '#js-repo-pjax-container')
|
||||
const url = `https://${window.location.host}/${userName}/${repoName}/pull/${pullId}/files?${search}`
|
||||
return new DOMParser().parseFromString(await (await fetch(url)).text(), 'text/html')
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ export const GitHub: Platform = {
|
|||
type: 'blob',
|
||||
name: item.filename?.replace(/^.*\//, '') || '',
|
||||
url: id
|
||||
? `https://${window.location.host}/${metaData.userName}/${metaData.repoName}/pull/${pullId}/files#${id}`
|
||||
? `https://${window.location.host}/${metaData.userName}/${metaData.repoName}/pull/${pullId}/files${window.location.search}#${id}`
|
||||
: `#`,
|
||||
contents: undefined,
|
||||
sha: item.sha,
|
||||
|
|
|
|||
Loading…
Reference in a new issue