Add AutoStart to first launch tour

This commit is contained in:
V
2023-06-21 16:52:28 +02:00
parent a993d34c9d
commit fd0055032f
3 changed files with 72 additions and 7 deletions

View File

@@ -11,16 +11,24 @@ import { join } from "path";
import { SplashProps } from "shared/browserWinProperties";
import { STATIC_DIR } from "shared/paths";
import { autoStart } from "./autoStart";
import { DATA_DIR } from "./constants";
import { createWindows } from "./mainWindow";
import { Settings } from "./settings";
interface Data {
minimizeToTray: boolean;
discordBranch: "stable" | "canary" | "ptb";
autoStart: boolean;
importSettings: boolean;
}
export function createFirstLaunchTour() {
const win = new BrowserWindow({
...SplashProps,
frame: true,
autoHideMenuBar: true,
height: 320,
height: 420,
width: 550
});
@@ -29,12 +37,14 @@ export function createFirstLaunchTour() {
if (msg === "cancel") return app.exit();
if (!msg.startsWith("form:")) return;
const data = JSON.parse(msg.slice(5));
const data = JSON.parse(msg.slice(5)) as Data;
Settings.store.minimizeToTray = data.minimizeToTray;
Settings.store.discordBranch = data.discordBranch;
Settings.store.firstLaunch = false;
if (data.autoStart) autoStart.enable();
if (data.importSettings) {
const from = join(app.getPath("userData"), "..", "Vencord", "settings");
const to = join(DATA_DIR, "settings");

View File

@@ -72,7 +72,7 @@ if (!app.requestSingleInstanceLock({ IS_DEV })) {
}
async function bootstrap() {
if (!Object.hasOwn(Settings.store, "firstLaunch")) {
if (!Object.hasOwn(Settings.store, "firstLaunch") || true) {
createFirstLaunchTour();
} else {
createWindows();