mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
The copyText wrapper is used in the `showStartedRecordingNotification` action, which is common for web and native. Provide a native implementation so the right one is bundled.
19 lines
400 B
TypeScript
19 lines
400 B
TypeScript
import clipboardCopy from 'clipboard-copy';
|
|
|
|
/**
|
|
* Tries to copy a given text to the clipboard.
|
|
* Returns true if the action succeeds.
|
|
*
|
|
* @param {string} textToCopy - Text to be copied.
|
|
* @returns {Promise<boolean>}
|
|
*/
|
|
export async function copyText(textToCopy: string) {
|
|
try {
|
|
await clipboardCopy(textToCopy);
|
|
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|