[ElCompat] Use Webpack module for clipboard copy

This commit is contained in:
Ducko 2021-07-20 20:56:11 +01:00 committed by Alyxia Sother
parent 7762d0bd07
commit 925b41459b
No known key found for this signature in database
GPG key ID: 355968D14144B739

View file

@ -1,7 +1,9 @@
const { copy } = goosemod.webpackModules.findByProps('SUPPORTS_COPY', 'copy'); // Use Webpack module for Web support (instead of DiscordNative)
export const writeText = (text) => { // Write text to clipboard export const writeText = (text) => { // Write text to clipboard
return DiscordNative.clipboard.copy(text); return copy(text);
}; };
export const readText = () => { // Read text from clipboard export const readText = () => { // Read text from clipboard
return DiscordNative.clipboard.read(); return DiscordNative.clipboard.read(); // Web doesn't support clipboard reading (no Webpack for it like copy) - use DiscordNative
}; };