borrar amigxs
This commit is contained in:
parent
316388582f
commit
8ead9e4a72
1 changed files with 11 additions and 5 deletions
|
@ -34,6 +34,9 @@
|
|||
|
||||
$: id = `${myUser.room};${myUser.password}`;
|
||||
const copiar = () => navigator.clipboard.writeText(id);
|
||||
|
||||
const remove = (id: UserIdentifier) =>
|
||||
($friends = $friends.filter((i) => i.room !== id.room));
|
||||
</script>
|
||||
|
||||
<button on:click={copiar}>copiar tu id</button>
|
||||
|
@ -51,10 +54,13 @@
|
|||
|
||||
<ul>
|
||||
{#each $allData as friend}
|
||||
<li>
|
||||
{#if friend.name}
|
||||
<li>{friend.name} <small>({friend.id.room})</small></li>
|
||||
{friend.name} <small>({friend.id.room})</small>
|
||||
{:else}
|
||||
<li>{friend.id.room}</li>
|
||||
{friend.id.room}
|
||||
{/if}
|
||||
<button on:click={() => remove(friend.id)}>❌</button>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in a new issue