From 6e0ee8adf4ea921706a87059141c77e5bc22e6d5 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 19 Oct 2023 19:33:27 -0400 Subject: [PATCH] Canary fallback to latest to avoid issues --- playlet-web/src/lib/Api/PlayletApi.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/playlet-web/src/lib/Api/PlayletApi.ts b/playlet-web/src/lib/Api/PlayletApi.ts index 2eba3864..eebda6c2 100644 --- a/playlet-web/src/lib/Api/PlayletApi.ts +++ b/playlet-web/src/lib/Api/PlayletApi.ts @@ -138,6 +138,14 @@ export class PlayletApi { link: `https://github.com/iBicha/playlet/releases/download/${tag}/playlet-lib.zip`, type: 'custom' }] + // When an official release is out, it replaces the current canary release. + // To avoid the "not found" error, we fallback to the default "latest" release. + if (tag === "canary") { + urls.push({ + link: `https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip`, + type: 'custom' + }) + } await PlayletApi.postJson(`${PlayletApi.host()}/api/playlet-lib-urls`, urls); } else { return await fetch(`${PlayletApi.host()}/api/playlet-lib-urls`, { method: "DELETE" });