From 968a030941033628082296e554e80be012002d51 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Sat, 11 Jul 2020 14:24:55 +0800 Subject: [PATCH] fix: hard redirect when id not available --- src/platforms/GitHub/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/GitHub/index.ts b/src/platforms/GitHub/index.ts index 9a6ce27..f9f3b96 100644 --- a/src/platforms/GitHub/index.ts +++ b/src/platforms/GitHub/index.ts @@ -112,9 +112,9 @@ export const GitHub: Platform = { path: item.filename || '', type: 'blob', name: item.filename?.replace(/^.*\//, '') || '', - url: id - ? `https://${window.location.host}/${metaData.userName}/${metaData.repoName}/pull/${pullId}/files${window.location.search}#${id}` - : `#`, + url: `https://${window.location.host}/${metaData.userName}/${ + metaData.repoName + }/pull/${pullId}/files${window.location.search}#${id || ''}`, contents: undefined, sha: item.sha, }