mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[ElCompat] Use Webpack module for clipboard copy
This commit is contained in:
parent
7762d0bd07
commit
925b41459b
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
};
|
};
|
Loading…
Reference in a new issue