mirror of
https://github.com/owncast/owncast.git
synced 2024-11-24 21:59:43 +03:00
Fix for copying stream key without revealing it only copies asterisks (#3663)
* asterisk copy fix for #3460 * rename text to keys for consistency + linting fix * make onCopy spawn an antd message directly, remove redundant copyText function --------- Co-authored-by: Muaz Ahmad <mahmad2000@protonmail.com>
This commit is contained in:
parent
9bbb09c911
commit
de8bc8d41b
1 changed files with 5 additions and 11 deletions
|
@ -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>
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue