fix titlebar loading

This commit is contained in:
smartfridge 2024-04-06 13:35:58 +02:00
parent c662b30ddc
commit 8545de1a9b
2 changed files with 6 additions and 6 deletions

View file

@ -4,7 +4,7 @@
/* Hidden by default */ /* Hidden by default */
position: fixed; position: fixed;
/* Stay in place */ /* Stay in place */
z-index: 9999999999999; z-index: 9999;
/* Sit on top */ /* Sit on top */
padding-top: 100px; padding-top: 100px;
/* Location of the box */ /* Location of the box */

View file

@ -61,17 +61,17 @@ sleep(5000).then(async () => {
addScript(fs.readFileSync(path.join(__dirname, "../", "/content/js/rpc.js"), "utf8")); addScript(fs.readFileSync(path.join(__dirname, "../", "/content/js/rpc.js"), "utf8"));
const cssPath = path.join(__dirname, "../", "/content/css/discord.css"); const cssPath = path.join(__dirname, "../", "/content/css/discord.css");
addStyle(fs.readFileSync(cssPath, "utf8")); addStyle(fs.readFileSync(cssPath, "utf8"));
await updateLang();
});
// Settings info version injection
setInterval(() => {
if (document.getElementById("window-controls-container") == null) { if (document.getElementById("window-controls-container") == null) {
console.warn("Titlebar didn't inject, retrying..."); console.warn("Titlebar didn't inject, retrying...");
if (ipcRenderer.sendSync("titlebar")) { if (ipcRenderer.sendSync("titlebar")) {
fixTitlebar(); fixTitlebar();
} }
} }
await updateLang();
});
// Settings info version injection
setInterval(() => {
addScript(` addScript(`
if (document.getElementById("ACsettingsModal") == null) { if (document.getElementById("ACsettingsModal") == null) {
var html = '<span class="close" id="closeSettings">&times;</span><div class="ACsettings-modal-content" id="webviewSettingsContainer"></div>'; var html = '<span class="close" id="closeSettings">&times;</span><div class="ACsettings-modal-content" id="webviewSettingsContainer"></div>';