diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-05 14:25:37 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-05 14:30:21 +0200 |
commit | 3e0355cb531c622c18c6bdfc3105572b3446be92 (patch) | |
tree | e968bfaefed2f04fe63174638480e1b50857a8e2 /src | |
parent | 7e526e4172412eba720ffd1fa34511046ef47e6b (diff) | |
download | Vencord-3e0355cb531c622c18c6bdfc3105572b3446be92.tar.gz Vencord-3e0355cb531c622c18c6bdfc3105572b3446be92.tar.bz2 Vencord-3e0355cb531c622c18c6bdfc3105572b3446be92.zip |
Fix consoleShortcuts for web
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/consoleShortcuts.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/consoleShortcuts.ts b/src/plugins/consoleShortcuts.ts index 4bc39c5..4b33d57 100644 --- a/src/plugins/consoleShortcuts.ts +++ b/src/plugins/consoleShortcuts.ts @@ -1,6 +1,10 @@ import { Devs } from "../utils/constants"; import definePlugin from "../utils/types"; +const WEB_ONLY = (f: string) => () => { + throw new Error(`'${f}' is Discord Desktop only.`); +}; + export default definePlugin({ name: "ConsoleShortcuts", description: "Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.", @@ -8,8 +12,8 @@ export default definePlugin({ getShortcuts() { return { - toClip: window.DiscordNative.clipboard.copy, - fromClip: window.DiscordNative.clipboard.read, + toClip: IS_WEB ? WEB_ONLY("toClip") : window.DiscordNative.clipboard.copy, + fromClip: IS_WEB ? WEB_ONLY("fromClip") : window.DiscordNative.clipboard.read, wp: Vencord.Webpack, wpc: Vencord.Webpack.wreq.c, wreq: Vencord.Webpack.wreq, @@ -22,7 +26,7 @@ export default definePlugin({ Settings: Vencord.Settings, Api: Vencord.Api, reload: () => location.reload(), - restart: () => window.DiscordNative.app.relaunch() + restart: IS_WEB ? WEB_ONLY("restart") : window.DiscordNative.app.relaunch }; }, |