From 33d270a6717e1b984356a6c2e9821d8463a80b6a Mon Sep 17 00:00:00 2001 From: Bobson Lin Date: Sun, 3 Jan 2021 23:22:38 +0800 Subject: [PATCH] Add pjax config for gitea and adjust getUrlForRedirect function. --- src/platforms/Gitea/index.ts | 2 +- src/utils/hooks/usePJAX.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platforms/Gitea/index.ts b/src/platforms/Gitea/index.ts index 44b7528..783b18f 100644 --- a/src/platforms/Gitea/index.ts +++ b/src/platforms/Gitea/index.ts @@ -68,7 +68,7 @@ function getUrlForRedirect( // `path => path.includes('#') ? path.replace(/#/g, '%23') : '...' return `https://${ window.location.host - }/${userName}/${repoName}/${type}/${branchName}/${path + }/${userName}/${repoName}/src/branch/${branchName}/${path .split('/') .map(encodeURIComponent) .join('/')}` diff --git a/src/utils/hooks/usePJAX.ts b/src/utils/hooks/usePJAX.ts index 5bcc62e..f3c26fa 100644 --- a/src/utils/hooks/usePJAX.ts +++ b/src/utils/hooks/usePJAX.ts @@ -8,6 +8,8 @@ const config: Config = { '.repository-content', // gitee '#git-project-content', + // gitea + '.repository > .ui.container' ], update: { css: false,