borrar amigxs

This commit is contained in:
Cat /dev/Nulo 2023-04-30 20:28:24 -03:00
parent 316388582f
commit 8ead9e4a72

View file

@ -34,6 +34,9 @@
$: id = `${myUser.room};${myUser.password}`; $: id = `${myUser.room};${myUser.password}`;
const copiar = () => navigator.clipboard.writeText(id); const copiar = () => navigator.clipboard.writeText(id);
const remove = (id: UserIdentifier) =>
($friends = $friends.filter((i) => i.room !== id.room));
</script> </script>
<button on:click={copiar}>copiar tu id</button> <button on:click={copiar}>copiar tu id</button>
@ -51,10 +54,13 @@
<ul> <ul>
{#each $allData as friend} {#each $allData as friend}
<li>
{#if friend.name} {#if friend.name}
<li>{friend.name} <small>({friend.id.room})</small></li> {friend.name} <small>({friend.id.room})</small>
{:else} {:else}
<li>{friend.id.room}</li> {friend.id.room}
{/if} {/if}
<button on:click={() => remove(friend.id)}>❌</button>
</li>
{/each} {/each}
</ul> </ul>