Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fix for copying stream key without revealing it only copies asterisks (#3663)

mahmed2000e5bd2d1bff74
diff --git a/web/components/admin/config/server/StreamKeys.tsx b/web/components/admin/config/server/StreamKeys.tsx
index 3c96b4f2ac..22d1e61180 100644
--- a/web/components/admin/config/server/StreamKeys.tsx
+++ b/web/components/admin/config/server/StreamKeys.tsx
@@ -135,12 +135,6 @@ const AddKeyButton = ({ setShowAddKeyForm }) => (
<PlusOutlined />
</Button>
);
-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 => (
<Space direction="horizontal">
<Paragraph
copyable={{
- text: showKeyMap[text] ? text : '**********',
- onCopy: () => copyText(text),
+ text: key,
+ onCopy: () => message.success('Copied to clipboard'),
}}
>
- {showKeyMap[text] ? text : '**********'}
+ {showKeyMap[key] ? key : '**********'}
</Paragraph>
<Button
type="link"
style={{ top: '-7px' }}
icon={<EyeOutlined />}
- onClick={() => handleToggleShowKey(text)}
+ onClick={() => handleToggleShowKey(key)}
/>
</Space>
),