fix: use watch for links not mount event (#3929)

This commit is contained in:
IMB11 2025-07-07 09:01:21 +01:00 committed by GitHub
parent 559d203996
commit 315c68912c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,15 +119,24 @@ const downloadLauncher = computed(() => {
} }
}); });
onBeforeMount(() => { const handleDownload = () => {
if (launcherUpdates.value?.platforms) { downloadLauncher.value();
macLinks.universal = launcherUpdates.value.platforms["darwin-aarch64"]?.install_urls[0] || null; };
windowsLink.value = launcherUpdates.value.platforms["windows-x86_64"]?.install_urls[0] || null;
linuxLinks.appImage = launcherUpdates.value.platforms["linux-x86_64"]?.install_urls[1] || null; watch(
linuxLinks.deb = launcherUpdates.value.platforms["linux-x86_64"]?.install_urls[0] || null; launcherUpdates,
linuxLinks.rpm = launcherUpdates.value.platforms["linux-x86_64"]?.install_urls[2] || null; (newData) => {
if (newData?.platforms) {
macLinks.universal = newData.platforms["darwin-aarch64"]?.install_urls[0] || null;
windowsLink.value = newData.platforms["windows-x86_64"]?.install_urls[0] || null;
linuxLinks.appImage = newData.platforms["linux-x86_64"]?.install_urls[1] || null;
linuxLinks.deb = newData.platforms["linux-x86_64"]?.install_urls[0] || null;
linuxLinks.rpm = newData.platforms["linux-x86_64"]?.install_urls[2] || null;
} }
}); },
{ immediate: true },
);
const scrollToSection = () => { const scrollToSection = () => {
nextTick(() => { nextTick(() => {
if (downloadSection.value) { if (downloadSection.value) {
@ -168,7 +177,7 @@ useSeoMeta({
v-if="os" v-if="os"
class="iconified-button brand-button btn btn-large" class="iconified-button brand-button btn btn-large"
rel="noopener nofollow" rel="noopener nofollow"
@click="downloadLauncher" @click="handleDownload"
> >
<svg <svg
v-if="os === 'Linux'" v-if="os === 'Linux'"