1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Ensure Drawer copyTitle() copies everything after the first ':'

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann 2021-11-17 10:29:47 -05:00
parent 2446b6cf9b
commit e9e1b726b7

View File

@ -147,9 +147,9 @@ export class Drawer extends React.Component<DrawerProps> {
};
copyTitle = (title: string) => {
const k8sObjName = title.split(":")[1] || title; // copy whole if no :
const itemName = title.split(":").splice(1).join(":") || title; // copy whole if no :
clipboard.writeText(k8sObjName.trim());
clipboard.writeText(itemName.trim());
this.setState({ isCopied: true });
setTimeout(() => {
this.setState({ isCopied: false });