fix first launch switches

This commit is contained in:
Vendicated 2024-07-04 19:30:03 +02:00
parent 281885a87e
commit 5fa4ae9824
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -18,11 +18,11 @@ import { Settings, State } from "./settings";
import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally"; import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally";
interface Data { interface Data {
minimizeToTray: boolean;
discordBranch: "stable" | "canary" | "ptb"; discordBranch: "stable" | "canary" | "ptb";
autoStart: boolean; minimizeToTray?: "on";
importSettings: boolean; autoStart?: "on";
richPresence: boolean; importSettings?: "on";
richPresence?: "on";
} }
export function createFirstLaunchTour() { export function createFirstLaunchTour() {
@ -44,10 +44,11 @@ export function createFirstLaunchTour() {
if (!msg.startsWith("form:")) return; if (!msg.startsWith("form:")) return;
const data = JSON.parse(msg.slice(5)) as Data; const data = JSON.parse(msg.slice(5)) as Data;
console.log(data);
State.store.firstLaunch = false; State.store.firstLaunch = false;
Settings.store.minimizeToTray = data.minimizeToTray;
Settings.store.discordBranch = data.discordBranch; Settings.store.discordBranch = data.discordBranch;
Settings.store.arRPC = data.richPresence; Settings.store.minimizeToTray = !!data.minimizeToTray;
Settings.store.arRPC = !!data.richPresence;
if (data.autoStart) autoStart.enable(); if (data.autoStart) autoStart.enable();