Remove wrong reactive function

This commit is contained in:
Brahim Hadriche committed 2023-07-07 17:48:44 -04:00
1 parent fef8df454a
commit 6da878edf9
1 file changed
+19 -12
+19 -12
View File
@@ -9,8 +9,25 @@
let libUrl; let libUrl;
let libUrlType; let libUrlType;
$: { onMount(async () => {
if (libUrlType === "custom") { releases = await fetchReleaseTags();
setCurrentlyUsedRelease();
});
playletStateStore.subscribe((value) => {
libUrl = value?.app?.lib_url;
libUrlType = value?.app?.lib_url_type;
setCurrentlyUsedRelease();
});
function setCurrentlyUsedRelease() {
if (libUrlType !== "custom") {
return;
}
if (releases.length === 0) {
return;
}
for (let i = 0; i < releases.length; i++) { for (let i = 0; i < releases.length; i++) {
const release = releases[i].name; const release = releases[i].name;
if ( if (
@@ -22,16 +39,6 @@
} }
} }
} }
}
onMount(async () => {
releases = await fetchReleaseTags();
});
playletStateStore.subscribe((value) => {
libUrl = value?.app?.lib_url;
libUrlType = value?.app?.lib_url_type;
});
async function fetchReleaseTags() { async function fetchReleaseTags() {
const response = await fetch( const response = await fetch(