Canary fallback to latest to avoid issues

This commit is contained in:
Brahim Hadriche committed 2023-10-19 19:33:27 -04:00
1 parent 74742c7e28
commit 6e0ee8adf4
1 file changed
+8
+8
View File
@@ -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" });