make Open Themes/Settings folder properly open the folder

This commit is contained in:
Vendicated 2025-06-14 18:51:40 +02:00
parent 2a398985cf
commit 78d3330ccf
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
6 changed files with 18 additions and 10 deletions

View file

@ -28,7 +28,7 @@ import { CspBlockedUrls, useCspErrors } from "@utils/cspViolations";
import { openInviteModal } from "@utils/discord";
import { Margins } from "@utils/margins";
import { classes } from "@utils/misc";
import { relaunch, showItemInFolder } from "@utils/native";
import { relaunch } from "@utils/native";
import { useAwaiter, useForceUpdater } from "@utils/react";
import { getStylusWebStoreUrl } from "@utils/web";
import { findLazy } from "@webpack";
@ -251,7 +251,7 @@ function ThemesTab() {
) : (
<QuickAction
text="Open Themes Folder"
action={() => showItemInFolder(themeDir!)}
action={() => VencordNative.themes.openFolder()}
disabled={themeDirPending}
Icon={FolderIcon}
/>

View file

@ -26,8 +26,7 @@ import { gitRemote } from "@shared/vencordUserAgent";
import { DONOR_ROLE_ID, VENCORD_GUILD_ID } from "@utils/constants";
import { Margins } from "@utils/margins";
import { identity, isPluginDev } from "@utils/misc";
import { relaunch, showItemInFolder } from "@utils/native";
import { useAwaiter } from "@utils/react";
import { relaunch } from "@utils/native";
import { Button, Forms, GuildMemberStore, React, Select, Switch, UserStore } from "@webpack/common";
import BadgeAPI from "../../plugins/_api/badges";
@ -53,9 +52,6 @@ type KeysOfType<Object, Type> = {
}[keyof Object];
function VencordSettings() {
const [settingsDir, , settingsDirPending] = useAwaiter(VencordNative.settings.getSettingsDir, {
fallbackValue: "Loading..."
});
const settings = useSettings();
const donateImage = React.useMemo(() => Math.random() > 0.5 ? DEFAULT_DONATE_IMAGE : SHIGGY_DONATE_IMAGE, []);
@ -171,7 +167,7 @@ function VencordSettings() {
<QuickAction
Icon={FolderIcon}
text="Open Settings Folder"
action={() => showItemInFolder(settingsDir)}
action={() => VencordNative.settings.openFolder()}
/>
)}
<QuickAction