diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-16 17:15:15 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-16 17:15:15 +0200 |
commit | 01ae0983b378ca478e7b6891e183718e8c45ed02 (patch) | |
tree | aac88bfa3bf4308fa067377c814fdd45a5601971 /src/plugins/clickableRoleDot.ts | |
parent | 845088ec024d56af4d7fdd4cd861c2aa89dbceb6 (diff) | |
download | Vencord-01ae0983b378ca478e7b6891e183718e8c45ed02.tar.gz Vencord-01ae0983b378ca478e7b6891e183718e8c45ed02.tar.bz2 Vencord-01ae0983b378ca478e7b6891e183718e8c45ed02.zip |
Optimise Web via treeshaking, cleanup build scripts
Diffstat (limited to 'src/plugins/clickableRoleDot.ts')
-rw-r--r-- | src/plugins/clickableRoleDot.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/clickableRoleDot.ts b/src/plugins/clickableRoleDot.ts index 61e6b28..28a511d 100644 --- a/src/plugins/clickableRoleDot.ts +++ b/src/plugins/clickableRoleDot.ts @@ -18,7 +18,16 @@ export default definePlugin({ ], copyToClipBoard(color: string) { - window.DiscordNative.clipboard.copy(color); + if (IS_WEB) { + navigator.clipboard.writeText(color) + .then(() => this.notifySuccess); + } else { + DiscordNative.clipboard.copy(color); + this.notifySuccess(); + } + }, + + notifySuccess() { Toasts.show({ message: "Copied to Clipboard!", type: Toasts.Type.SUCCESS, |