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}`;
|
$: 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>
|
||||||
|
|
Loading…
Reference in a new issue