Fix: IPC button not working

This commit is contained in:
MasterAcnolo
2026-04-12 11:22:31 +02:00
parent 60137a15dc
commit 5aebc78d44
2 changed files with 24 additions and 24 deletions

View File

@@ -36,7 +36,12 @@ async function loadSettings() {
// Open The JSON
document.getElementById("open-json-btn").addEventListener("click", () => {
window.topbarAPI.openConfig(); // ton IPC existant
window.topbarAPI.openConfig();
});
// Open Theme Folder
document.getElementById("open-theme").addEventListener("click", () => {
window.topbarAPI.openTheme();
});
// Refresh Themes

View File

@@ -1,8 +1,8 @@
// Ajout des listeners pour la topbar
function setupTopbarListeners() {
document.addEventListener('DOMContentLoaded', () => {
const { topbarAPI } = window;
if (!topbarAPI) return;
const minBtn = document.getElementById('minimize-btn');
const maxBtn = document.getElementById('maximize-btn');
const closeBtn = document.getElementById('close-btn');
@@ -10,8 +10,6 @@ function setupTopbarListeners() {
const logsBtn = document.getElementById('logs-btn');
const websiteBtn = document.getElementById('website-btn');
const wikiBtn = document.getElementById('wiki-btn');
const themeBtn = document.getElementById('theme-btn');
const configBtn = document.getElementById('config-btn');
if (minBtn) minBtn.onclick = () => topbarAPI.minimize();
if (maxBtn) maxBtn.onclick = () => topbarAPI.maximize();
@@ -20,12 +18,9 @@ function setupTopbarListeners() {
if (logsBtn) logsBtn.onclick = () => topbarAPI.openLogs();
if (websiteBtn) websiteBtn.onclick = () => topbarAPI.openWebsite();
if (wikiBtn) wikiBtn.onclick = () => topbarAPI.openWiki();
if (themeBtn) themeBtn.onclick = () => topbarAPI.openTheme();
if (configBtn) configBtn.onclick = () => topbarAPI.openConfig();
});
}
setupTopbarListeners(); // IF it put it the if check. It don't work. Why ?
document.addEventListener('DOMContentLoaded', setupTopbarListeners);
const features = await window.electronAPI.getFeatures();