diff --git a/pkg/interface/src/views/apps/chat/components/lib/message.js b/pkg/interface/src/views/apps/chat/components/lib/message.js index 461423db7..c47d3f2ab 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/message.js +++ b/pkg/interface/src/views/apps/chat/components/lib/message.js @@ -60,6 +60,15 @@ const renderWithSigil = (props, timestamp) => { name = cite(props.msg.author); } + let nameSpan = null; + + const copyNotice = (saveName) => { + nameSpan.innerText = 'Copied'; + setTimeout(() => { + nameSpan.innerText = saveName; + }, 800); + }; + return (
{ 'mw5 db truncate pointer ' + (contact.nickname ? '' : 'mono') } + ref={(e) => nameSpan = e} onClick={() => { + const saveName = name; writeText(props.msg.author); + copyNotice(saveName); }} title={`~${props.msg.author}`} >