aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/clickableRoleDot.ts
diff options
context:
space:
mode:
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,