From eebce839762a7a2074c2fa1c509b9d02ef9c566e Mon Sep 17 00:00:00 2001 From: MasterAcnolo Date: Sun, 28 Jun 2026 21:34:00 +0200 Subject: [PATCH] fix: small code quality and mismatch. --- CONTRIBUTING.md | 2 +- SECURITY.md | 2 +- app/autoUpdater.js | 7 +++++-- app/ipcHandlers.js | 1 - app/themeManager.js | 1 - public/script/clipboardPaste.js | 4 +--- public/script/fetchinfo.js | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fca3c0f..0e531b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,7 +105,7 @@ Freedom-Loader/ │ ├── controller/ # Business logic │ └── helpers/ # Utility functions ├── public/ # Frontend (HTML, CSS, JS) -└── ressources/ # Binaries (yt-dlp, ffmpeg, etc.) +└── resources/ # Binaries (yt-dlp, ffmpeg, etc.) ``` --- diff --git a/SECURITY.md b/SECURITY.md index 0412d84..f6623ed 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,7 +5,7 @@ We actively maintain and provide security updates for the following versions of Freedom Loader: | Version | Supported | -| ------- | ------------------ | +|---------|--------------------| | 1.4.x | :white_check_mark: | | 1.3.x | :white_check_mark: | | < 1.3.0 | :x: | diff --git a/app/autoUpdater.js b/app/autoUpdater.js index de06235..cf2a67d 100644 --- a/app/autoUpdater.js +++ b/app/autoUpdater.js @@ -15,7 +15,7 @@ const { logger } = require("../server/logger"); /** * Configures autoUpdater behavior: * - disables automatic download - * - disables automatic install on quit + * - disables automatic installation on quit * (manual user-controlled update flow) */ autoUpdater.autoDownload = false; @@ -51,7 +51,7 @@ function initAutoUpdater(mainWindow) { }); if (response === 0) { - autoUpdater.downloadUpdate(); + await autoUpdater.downloadUpdate(); } else { mainWindow?.webContents.executeJavaScript( `window.showUpdateBadge && window.showUpdateBadge("${info.version}")` @@ -108,6 +108,9 @@ function initAutoUpdater(mainWindow) { * Separated from init for reusability and testability. */ async function checkForUpdates() { + + if (!require("electron").app.isPackaged) return ; + try { await autoUpdater.checkForUpdates(); } catch (err) { diff --git a/app/ipcHandlers.js b/app/ipcHandlers.js index b616e64..2e77918 100644 --- a/app/ipcHandlers.js +++ b/app/ipcHandlers.js @@ -12,7 +12,6 @@ const { ipcMain, dialog, shell } = require("electron"); const fs = require("fs"); -const path = require("path"); const { logger, logDir } = require("../server/logger"); const { configFeatures, featuresPath } = require("../config"); const { getThemes, reloadThemes } = require("./themeManager"); diff --git a/app/themeManager.js b/app/themeManager.js index b2e6616..bfbe691 100644 --- a/app/themeManager.js +++ b/app/themeManager.js @@ -270,7 +270,6 @@ async function loadThemesFromFolder() { if (fs.statSync(filePath).isDirectory()) { const theme = await loadThemeFromFolder(filePath, themeId); if (theme) themes.push(theme); - continue; } } diff --git a/public/script/clipboardPaste.js b/public/script/clipboardPaste.js index 5ec227f..3d2a8e2 100644 --- a/public/script/clipboardPaste.js +++ b/public/script/clipboardPaste.js @@ -17,9 +17,7 @@ document.addEventListener("DOMContentLoaded", () => { */ pasteBtn.addEventListener("click", async () => { try { - const text = await navigator.clipboard.readText(); - - urlInput.value = text; + urlInput.value = await navigator.clipboard.readText(); // Notify frameworks / listeners bound to input changes urlInput.dispatchEvent(new Event("input", { bubbles: true })); diff --git a/public/script/fetchinfo.js b/public/script/fetchinfo.js index 4391eb9..2ae824c 100644 --- a/public/script/fetchinfo.js +++ b/public/script/fetchinfo.js @@ -271,6 +271,6 @@ async function init() { }) -}; +} init(); \ No newline at end of file