fix(copy): prevent shorthand copy if source is present in useCopy
This commit is contained in:
parent
7b6232a151
commit
e54cb6f995
@ -7,7 +7,13 @@ export function useCopy({ source, text = 'Copied to the clipboard' }: { source?:
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
async copy(content?: string, { notificationMessage }: { notificationMessage?: string } = {}) {
|
async copy(content?: string, { notificationMessage }: { notificationMessage?: string } = {}) {
|
||||||
await copy(content);
|
if (source) {
|
||||||
|
await copy();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
await copy(content);
|
||||||
|
}
|
||||||
|
|
||||||
message.success(notificationMessage ?? text);
|
message.success(notificationMessage ?? text);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user