snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
18
react/features/base/util/copyText.native.ts
Normal file
18
react/features/base/util/copyText.native.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
|
||||
/**
|
||||
* 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 function copyText(textToCopy: string) {
|
||||
try {
|
||||
Clipboard.setString(textToCopy);
|
||||
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user