From 8494589b6072806724d581a659587a13576ac627 Mon Sep 17 00:00:00 2001 From: Yuki Takizawa Date: Mon, 21 Mar 2022 02:13:52 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20ID=E3=82=92=E3=82=AF=E3=83=AA=E3=83=83?= =?UTF-8?q?=E3=83=97=E3=83=9C=E3=83=BC=E3=83=89=E3=81=B8=E3=82=B3=E3=83=94?= =?UTF-8?q?=E3=83=BC=E3=81=99=E3=82=8B=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/component/peer-menu/peer-menu.component.html | 3 ++- src/app/component/peer-menu/peer-menu.component.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/component/peer-menu/peer-menu.component.html b/src/app/component/peer-menu/peer-menu.component.html index 4d2d73822..3ee0d40c1 100644 --- a/src/app/component/peer-menu/peer-menu.component.html +++ b/src/app/component/peer-menu/peer-menu.component.html @@ -7,7 +7,8 @@ あなたのニックネーム:
- あなたのID:{{networkService.peerContext.userId}} + あなたのID:{{networkService.peerContext.userId}} + ???
diff --git a/src/app/component/peer-menu/peer-menu.component.ts b/src/app/component/peer-menu/peer-menu.component.ts index b8748ecd7..3272ae7a9 100644 --- a/src/app/component/peer-menu/peer-menu.component.ts +++ b/src/app/component/peer-menu/peer-menu.component.ts @@ -134,4 +134,14 @@ export class PeerMenuComponent implements OnInit, OnDestroy, AfterViewInit { const peerCursor = PeerCursor.findByPeerId(peerId); return peerCursor ? peerCursor.name : ''; } + + copyUserIdToClipboard() { + var userId = document.querySelector("#userId").textContent; + navigator.clipboard.writeText(userId) + .then( + () => { }, + (err) => { + console.error("Failed to copy userId: ", err); + }); + } }