fixed bug with vencord crashing on opening settings
This commit is contained in:
parent
e764c51e77
commit
f30a94df43
4 changed files with 9 additions and 2 deletions
|
@ -40,6 +40,11 @@ handleSync(
|
||||||
() => process.platform === "win32" && Number(release().split(".").pop()) >= 22621
|
() => process.platform === "win32" && Number(release().split(".").pop()) >= 22621
|
||||||
);
|
);
|
||||||
|
|
||||||
|
handleSync(
|
||||||
|
IpcEvents.IS_WINDOWS,
|
||||||
|
() => process.platform === "win32"
|
||||||
|
);
|
||||||
|
|
||||||
handleSync(IpcEvents.AUTOSTART_ENABLED, () => autoStart.isEnabled());
|
handleSync(IpcEvents.AUTOSTART_ENABLED, () => autoStart.isEnabled());
|
||||||
handle(IpcEvents.ENABLE_AUTOSTART, autoStart.enable);
|
handle(IpcEvents.ENABLE_AUTOSTART, autoStart.enable);
|
||||||
handle(IpcEvents.DISABLE_AUTOSTART, autoStart.disable);
|
handle(IpcEvents.DISABLE_AUTOSTART, autoStart.disable);
|
||||||
|
|
|
@ -24,7 +24,8 @@ export const VesktopNative = {
|
||||||
relaunch: () => invoke<void>(IpcEvents.RELAUNCH),
|
relaunch: () => invoke<void>(IpcEvents.RELAUNCH),
|
||||||
getVersion: () => sendSync<void>(IpcEvents.GET_VERSION),
|
getVersion: () => sendSync<void>(IpcEvents.GET_VERSION),
|
||||||
setBadgeCount: (count: number) => invoke<void>(IpcEvents.SET_BADGE_COUNT, count),
|
setBadgeCount: (count: number) => invoke<void>(IpcEvents.SET_BADGE_COUNT, count),
|
||||||
supportsWindowsTransparency: () => sendSync<boolean>(IpcEvents.SUPPORTS_WINDOWS_TRANSPARENCY)
|
supportsWindowsTransparency: () => sendSync<boolean>(IpcEvents.SUPPORTS_WINDOWS_TRANSPARENCY),
|
||||||
|
isWindows: () => sendSync<boolean>(IpcEvents.IS_WINDOWS)
|
||||||
},
|
},
|
||||||
autostart: {
|
autostart: {
|
||||||
isEnabled: () => sendSync<boolean>(IpcEvents.AUTOSTART_ENABLED),
|
isEnabled: () => sendSync<boolean>(IpcEvents.AUTOSTART_ENABLED),
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { isTruthy } from "shared/utils/guards";
|
||||||
export default function SettingsUi() {
|
export default function SettingsUi() {
|
||||||
const Settings = useSettings();
|
const Settings = useSettings();
|
||||||
const supportsWindowsTransparency = VesktopNative.app.supportsWindowsTransparency();
|
const supportsWindowsTransparency = VesktopNative.app.supportsWindowsTransparency();
|
||||||
const isWindows = process.platform === "win32";
|
const isWindows = VesktopNative.app.isWindows();
|
||||||
|
|
||||||
const { autostart } = VesktopNative;
|
const { autostart } = VesktopNative;
|
||||||
const [autoStartEnabled, setAutoStartEnabled] = useState(autostart.isEnabled());
|
const [autoStartEnabled, setAutoStartEnabled] = useState(autostart.isEnabled());
|
||||||
|
|
|
@ -12,6 +12,7 @@ export const enum IpcEvents {
|
||||||
|
|
||||||
GET_VERSION = "VCD_GET_VERSION",
|
GET_VERSION = "VCD_GET_VERSION",
|
||||||
SUPPORTS_WINDOWS_TRANSPARENCY = "VCD_SUPPORTS_WINDOWS_TRANSPARENCY",
|
SUPPORTS_WINDOWS_TRANSPARENCY = "VCD_SUPPORTS_WINDOWS_TRANSPARENCY",
|
||||||
|
IS_WINDOWS = "VCD_IS_WINDOWS",
|
||||||
|
|
||||||
RELAUNCH = "VCD_RELAUNCH",
|
RELAUNCH = "VCD_RELAUNCH",
|
||||||
CLOSE = "VCD_CLOSE",
|
CLOSE = "VCD_CLOSE",
|
||||||
|
|
Reference in a new issue