mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
Deal with flash of wrong platform
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
import type { Endpoints } from "@octokit/types";
|
||||
|
||||
export let releaseData: Endpoints["GET /repos/{owner}/{repo}/releases/latest"]["response"]["data"];
|
||||
import { browser } from '$app/environment';
|
||||
// console.log(releaseData);
|
||||
</script>
|
||||
|
||||
<div class="release">
|
||||
{#if navigator}
|
||||
{#if !browser &&navigator}
|
||||
{#if navigator.platform.startsWith("Win")}
|
||||
{@const asset =releaseData.assets.filter((a) => a.name.endsWith(".exe"))[0]}
|
||||
{#if asset}
|
||||
@@ -25,6 +26,7 @@
|
||||
<a href={asset.browser_download_url}>Download AppImage</a>
|
||||
{/if}
|
||||
{/if}
|
||||
<!-- {:else} -->
|
||||
{/if}
|
||||
<p>Latest release: <a href={releaseData.html_url}>{releaseData.name}</a></p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user