Merge pull request #3552 from microsoft/hediet/educational-blackbird

Fixes commit reveal bug
This commit is contained in:
Henning Dieterichs 2023-02-13 10:59:55 +01:00 committed by GitHub
commit 383b675c0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,16 @@ export async function getVsCodeCommitId(
monacoEditorVersion: string
): Promise<string | undefined> {
// TODO https://cdn.jsdelivr.net/npm/monaco-editor@${monacoEditorVersion}/package.json
return knownVersionVsCodeCommitIds[monacoEditorVersion];
let commitId = knownVersionVsCodeCommitIds[monacoEditorVersion];
if (!commitId) {
const json = (await (
await fetch(
`https://cdn.jsdelivr.net/npm/monaco-editor@${monacoEditorVersion}}/package.json`
)
).json()) as { vscodeCommitId: string };
commitId = json.vscodeCommitId;
}
return commitId;
}
const knownVersionVsCodeCommitIds: Record<string, string> = {