From dd59f90b1516b52f1f9196d7808726c914956d6c Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 13 Feb 2023 10:44:47 +0100 Subject: [PATCH] Fixes commit reveal bug --- .../website/pages/playground/getNpmVersionsSync.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/website/src/website/pages/playground/getNpmVersionsSync.tsx b/website/src/website/pages/playground/getNpmVersionsSync.tsx index 41cad070..a8cb86ae 100644 --- a/website/src/website/pages/playground/getNpmVersionsSync.tsx +++ b/website/src/website/pages/playground/getNpmVersionsSync.tsx @@ -59,7 +59,16 @@ export async function getVsCodeCommitId( monacoEditorVersion: string ): Promise { // 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 = {