Clipboard Fixes

This commit is contained in:
thororen1234 2025-04-16 22:52:50 -04:00
parent 5d00294ee5
commit 506e3dcfd6
No known key found for this signature in database
12 changed files with 38 additions and 34 deletions

View file

@ -6,9 +6,10 @@
import { showNotification } from "@api/Notifications";
import { Settings } from "@api/Settings";
import { copyToClipboard } from "@utils/clipboard";
import { relaunch, showItemInFolder } from "@utils/native";
import { checkForUpdates, getRepo } from "@utils/updater";
import { Clipboard, GuildStore, NavigationRouter, SettingsRouter, Toasts } from "@webpack/common";
import { GuildStore, NavigationRouter, SettingsRouter, Toasts } from "@webpack/common";
import gitHash from "~git-hash";
import gitRemote from "~git-remote";
@ -89,7 +90,7 @@ export const actions: ButtonAction[] = [
const newUrl = url.replace(/(https?:\/\/)?([a-zA-Z0-9-]+)\.([a-zA-Z0-9-]+)/, "https://$2.$3");
const res = (await fetch(newUrl));
const text = await res.text();
Clipboard.copy(text);
copyToClipboard(text);
Toasts.show({
message: "Copied response to clipboard!",
@ -115,7 +116,7 @@ export const actions: ButtonAction[] = [
{
id: "copyGitInfo", label: "Copy Git Info", callback: async () => {
Clipboard.copy(`gitHash: ${gitHash}\ngitRemote: ${gitRemote}`);
copyToClipboard(`gitHash: ${gitHash}\ngitRemote: ${gitRemote}`);
Toasts.show({
message: "Copied git info to clipboard!",