Remove Schem Download
This commit is contained in:
@@ -24,19 +24,12 @@
|
||||
import {createEventDispatcher} from "svelte";
|
||||
import type {Player} from "@type/data.ts";
|
||||
import dayjs from "dayjs";
|
||||
import {schemRepo} from "@repo/schem.ts";
|
||||
import SWModal from "@components/styled/SWModal.svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let info: SchematicInfo;
|
||||
export let user: Player;
|
||||
|
||||
async function download() {
|
||||
const code = await $schemRepo.createDownload(info.schem.id);
|
||||
window.open(import.meta.env.PUBLIC_API_SERVER + "/download/" + code.code, "_blank")
|
||||
dispatch("reset")
|
||||
}
|
||||
</script>
|
||||
|
||||
<SWModal title={info.schem.name} open on:close={() => dispatch("reset")}>
|
||||
@@ -71,9 +64,6 @@
|
||||
<p class="!mt-0">{t("dashboard.schematic.info.members", {members: info.members.map(value => value.name).join(", ")})}</p>
|
||||
{/if}
|
||||
<svelte:fragment slot="footer">
|
||||
{#if (info.schem.owner === user.id)}
|
||||
<button class="btn !ml-auto" on:click={download}>{t("dashboard.schematic.info.btn.download")}</button>
|
||||
{/if}
|
||||
<button class="btn" class:!ml-auto={info.schem.owner !== user.id} on:click={() => dispatch("reset")}>{t("dashboard.schematic.info.btn.close")}</button>
|
||||
</svelte:fragment>
|
||||
</SWModal>
|
||||
Reference in New Issue
Block a user