fix: hard redirect when id not available

This commit is contained in:
EnixCoda 2020-07-11 14:24:55 +08:00
parent c40aeec355
commit 968a030941
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -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,
}