aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/clickableRoleDot.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-16 17:15:15 +0200
committerVendicated <vendicated@riseup.net>2022-10-16 17:15:15 +0200
commit01ae0983b378ca478e7b6891e183718e8c45ed02 (patch)
treeaac88bfa3bf4308fa067377c814fdd45a5601971 /src/plugins/clickableRoleDot.ts
parent845088ec024d56af4d7fdd4cd861c2aa89dbceb6 (diff)
downloadVencord-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.ts11
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,