Show error toast when selecting invalid venchord dir

This commit is contained in:
V 2023-08-12 03:15:21 +02:00
parent 28ad4a6f73
commit 6ee920ff2c
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905

View file

@ -7,7 +7,7 @@
import "./settings.css";
import { Margins } from "@vencord/types/utils";
import { Button, Forms, Select, Switch, Text, useState } from "@vencord/types/webpack/common";
import { Button, Forms, Select, Switch, Text, Toasts, useState } from "@vencord/types/webpack/common";
import { setBadge } from "renderer/appBadge";
import { useSettings } from "renderer/settings";
import { isMac, isWindows } from "renderer/utils";
@ -169,8 +169,14 @@ export default function SettingsUi() {
const choice = await VesktopNative.fileManager.selectVencordDir();
switch (choice) {
case "cancelled":
return;
case "invalid":
// TODO
Toasts.show({
message:
"You did not choose a valid Vencord install. Make sure you're selecting the dist dir!",
id: Toasts.genId(),
type: Toasts.Type.FAILURE
});
return;
}
Settings.vencordDir = choice;