Enable titlebar fix

This commit is contained in:
smartfridge 2022-12-10 22:39:30 +01:00
parent 5bcbbacee1
commit 6c8eb71d46

View file

@ -4,7 +4,7 @@ import "./capturer";
import "./patch";
import * as fs from "fs";
import * as path from "path";
import {injectHummusTitlebar, injectTitlebar} from "./titlebar";
import {fixTitlebar, injectHummusTitlebar, injectTitlebar} from "./titlebar";
import {sleep, addStyle, addScript} from "../utils";
import {injectMobileStuff} from "./mobile";
var version = ipcRenderer.sendSync("displayVersion");
@ -61,6 +61,16 @@ if (window.location.href.indexOf("splash.html") > -1) {
addScript(fs.readFileSync(path.join(__dirname, "../", "/content/js/rpc.js"), "utf8"));
const cssPath = path.join(__dirname, "../", "/content/css/discord.css");
addStyle(fs.readFileSync(cssPath, "utf8"));
if (document.getElementById("window-controls-container") == null) {
console.warn("Titlebar didn't inject, retrying...");
if (ipcRenderer.sendSync("titlebar")) {
if (channel == "hummus") {
injectHummusTitlebar();
} else {
fixTitlebar();
}
}
}
await updateLang();
});
}