From 8e4b229cfa9e257c4fdc123159cc09f2dfbb3e07 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 15:54:40 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../components/pages/settings/SettingsPage.js | 15 ++---- src/electron/frontend/utils/auto-update.js | 50 +++++++++---------- 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/src/electron/frontend/core/components/pages/settings/SettingsPage.js b/src/electron/frontend/core/components/pages/settings/SettingsPage.js index dc0d47f55..d5ea234ea 100644 --- a/src/electron/frontend/core/components/pages/settings/SettingsPage.js +++ b/src/electron/frontend/core/components/pages/settings/SettingsPage.js @@ -15,18 +15,9 @@ import { merge, setUndefinedIfNotDeclared } from "../utils"; import { notyf } from "../../../dependencies.js"; import { homeDirectory, testDataFolderPath } from "../../../globals.js"; -import { - SERVER_FILE_PATH, - electron, - path, - port, - fs, -} from "../../../../utils/electron.js"; - -import { - onUpdateAvailable, - onUpdateProgress, -} from "../../../../utils/auto-update.js"; +import { SERVER_FILE_PATH, electron, path, port, fs } from "../../../../utils/electron.js"; + +import { onUpdateAvailable, onUpdateProgress } from "../../../../utils/auto-update.js"; import saveSVG from "../../../../assets/icons/save.svg?raw"; import folderSVG from "../../../../assets/icons/folder_open.svg?raw"; diff --git a/src/electron/frontend/utils/auto-update.js b/src/electron/frontend/utils/auto-update.js index 05696269c..4b4452ebd 100644 --- a/src/electron/frontend/utils/auto-update.js +++ b/src/electron/frontend/utils/auto-update.js @@ -1,25 +1,25 @@ -let updateAvailable = false; -const updateAvailableCallbacks = []; -export const onUpdateAvailable = (callback) => { - if (updateAvailable) callback(updateAvailable); - else updateAvailableCallbacks.push(callback); -}; - -let updateProgress = null; - -const updateProgressCallbacks = []; -export const onUpdateProgress = (callback) => { - if (updateProgress) callback(updateProgress); - else updateProgressCallbacks.push(callback); -}; - -export const registerUpdateProgress = (info) => { - updateProgress = info; - updateProgressCallbacks.forEach((cb) => cb(info)); -}; - -export const registerUpdate = (info) => { - updateAvailable = info; - document.body.setAttribute("data-update-available", JSON.stringify(info)); - updateAvailableCallbacks.forEach((cb) => cb(info)); -}; +let updateAvailable = false; +const updateAvailableCallbacks = []; +export const onUpdateAvailable = (callback) => { + if (updateAvailable) callback(updateAvailable); + else updateAvailableCallbacks.push(callback); +}; + +let updateProgress = null; + +const updateProgressCallbacks = []; +export const onUpdateProgress = (callback) => { + if (updateProgress) callback(updateProgress); + else updateProgressCallbacks.push(callback); +}; + +export const registerUpdateProgress = (info) => { + updateProgress = info; + updateProgressCallbacks.forEach((cb) => cb(info)); +}; + +export const registerUpdate = (info) => { + updateAvailable = info; + document.body.setAttribute("data-update-available", JSON.stringify(info)); + updateAvailableCallbacks.forEach((cb) => cb(info)); +};