From ad540967f357ff0a60e0fcabd89dba3d92a82d92 Mon Sep 17 00:00:00 2001 From: Eric Harris-Braun Date: Thu, 18 Jan 2024 13:08:44 -0500 Subject: [PATCH] removed delete attachments from main page, and added Bound To display --- ui/src/AttachmentsList.svelte | 26 ++++++++++++++++---------- ui/src/Controller.svelte | 2 +- ui/src/GamezPane.svelte | 13 +++++++++++-- ui/src/defaultGames.ts | 21 +++++++++++++++++++++ ui/src/store.ts | 7 ++++--- we_dev/config.json | 2 +- 6 files changed, 54 insertions(+), 17 deletions(-) diff --git a/ui/src/AttachmentsList.svelte b/ui/src/AttachmentsList.svelte index 59daba3..fc75b51 100644 --- a/ui/src/AttachmentsList.svelte +++ b/ui/src/AttachmentsList.svelte @@ -10,6 +10,7 @@ const dispatch = createEventDispatcher() export let attachments: Array + export let allowDelete = true const { getStore } :any = getContext("gzStore"); let store: GamezStore = getStore(); @@ -17,7 +18,10 @@
{#each attachments as attachment, index} -
+
{#await store.weClient.attachableInfo(hrlB64WithContextToRaw(attachment))} {:then { attachableInfo }} @@ -29,13 +33,15 @@ style="display:flex;flex-direction:row;margin-right:5px"> {attachableInfo.name} - { - dispatch("remove-attachment",index) - }} - > - - + {#if allowDelete} + { + dispatch("remove-attachment",index) + }} + > + + + {/if} {:catch error} Oops. something's wrong. {/await} @@ -44,13 +50,13 @@