2023-04-09 22:49:50 +02:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: GPL-3.0
|
|
|
|
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
|
|
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
|
|
|
*/
|
|
|
|
|
2023-04-27 02:23:17 +02:00
|
|
|
import { app, BrowserWindow } from "electron";
|
|
|
|
import { readFileSync } from "fs";
|
2023-04-05 17:55:49 +02:00
|
|
|
import { join } from "path";
|
2023-06-23 17:20:54 +02:00
|
|
|
import { ICON_PATH, VIEW_DIR } from "shared/paths";
|
2023-04-09 22:49:50 +02:00
|
|
|
|
2023-04-05 17:55:49 +02:00
|
|
|
import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally";
|
|
|
|
|
|
|
|
export function createAboutWindow() {
|
|
|
|
const about = new BrowserWindow({
|
|
|
|
center: true,
|
|
|
|
autoHideMenuBar: true,
|
|
|
|
icon: ICON_PATH
|
|
|
|
});
|
|
|
|
|
|
|
|
makeLinksOpenExternally(about);
|
|
|
|
|
2023-06-23 17:20:54 +02:00
|
|
|
const html = readFileSync(join(VIEW_DIR, "about.html"), "utf-8").replaceAll("%VERSION%", app.getVersion());
|
2023-04-27 02:23:17 +02:00
|
|
|
|
|
|
|
about.loadURL("data:text/html;charset=utf-8," + html);
|
2023-04-05 17:55:49 +02:00
|
|
|
|
|
|
|
return about;
|
|
|
|
}
|