mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +00:00
Fix git diff including 404 responses
This commit is contained in:
@@ -54,8 +54,8 @@ export function VersionDiff({ version }: Props) {
|
||||
return { file, diff: [] }
|
||||
} else if (isText) {
|
||||
const [beforeStr, afterStr] = await Promise.all([
|
||||
fetch(`${mcmetaRawUrl}/${commit?.parents[0].sha}/${filename}`).then(r => r.text()),
|
||||
fetch(`${mcmetaRawUrl}/${version}-diff/${filename}`).then(r => r.text()),
|
||||
fetch(`${mcmetaRawUrl}/${commit?.parents[0].sha}/${filename}`).then(r => r.ok ? r.text() : ''),
|
||||
fetch(`${mcmetaRawUrl}/${version}-diff/${filename}`).then(r => r.ok ? r.text() : ''),
|
||||
])
|
||||
patch = createPatch(filename, beforeStr, afterStr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user