mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/SavingDialog: hide buttons when actions are not supported
This commit is contained in:
parent
32743360be
commit
2fa1ad8f12
1 changed files with 25 additions and 18 deletions
|
@ -1,6 +1,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from "$lib/i18n/translations";
|
import { t } from "$lib/i18n/translations";
|
||||||
|
|
||||||
|
import { app, device } from "$lib/device";
|
||||||
import { copyURL, openURL, shareURL } from "$lib/download";
|
import { copyURL, openURL, shareURL } from "$lib/download";
|
||||||
|
|
||||||
import DialogContainer from "$components/dialog/DialogContainer.svelte";
|
import DialogContainer from "$components/dialog/DialogContainer.svelte";
|
||||||
|
@ -33,24 +34,30 @@
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<VerticalActionButton
|
{#if !(app.is.installed && device.is.iOS)}
|
||||||
id="save-download"
|
<VerticalActionButton
|
||||||
fill
|
id="save-download"
|
||||||
elevated
|
fill
|
||||||
click={() => openURL(url)}
|
elevated
|
||||||
>
|
click={() => openURL(url)}
|
||||||
<IconDownload />
|
>
|
||||||
{$t("dialog.button.download")}
|
<IconDownload />
|
||||||
</VerticalActionButton>
|
{$t("dialog.button.download")}
|
||||||
<VerticalActionButton
|
</VerticalActionButton>
|
||||||
id="save-share"
|
{/if}
|
||||||
fill
|
|
||||||
elevated
|
{#if navigator.share !== undefined}
|
||||||
click={async () => await shareURL(url)}
|
<VerticalActionButton
|
||||||
>
|
id="save-share"
|
||||||
<IconShare2 />
|
fill
|
||||||
{$t("dialog.button.share")}
|
elevated
|
||||||
</VerticalActionButton>
|
click={async () => await shareURL(url)}
|
||||||
|
>
|
||||||
|
<IconShare2 />
|
||||||
|
{$t("dialog.button.share")}
|
||||||
|
</VerticalActionButton>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<VerticalActionButton
|
<VerticalActionButton
|
||||||
id="save-copy"
|
id="save-copy"
|
||||||
fill
|
fill
|
||||||
|
|
Loading…
Reference in a new issue