diff --git a/web/components/admin/config/server/StreamKeys.tsx b/web/components/admin/config/server/StreamKeys.tsx index 3c96b4f2a..22d1e6118 100644 --- a/web/components/admin/config/server/StreamKeys.tsx +++ b/web/components/admin/config/server/StreamKeys.tsx @@ -135,12 +135,6 @@ const AddKeyButton = ({ setShowAddKeyForm }) => ( ); -const copyText = (text: string) => { - navigator.clipboard - .writeText(text) - .then(() => message.success('Copied to clipboard')) - .catch(() => message.error('Failed to copy to clipboard')); -}; const StreamKeys = () => { const serverStatusData = useContext(ServerStatusContext); @@ -171,22 +165,22 @@ const StreamKeys = () => { title: 'Key', dataIndex: 'key', key: 'key', - render: text => ( + render: key => ( copyText(text), + text: key, + onCopy: () => message.success('Copied to clipboard'), }} > - {showKeyMap[text] ? text : '**********'} + {showKeyMap[key] ? key : '**********'}