diff --git a/src/main.ts b/src/main.ts index 7215eb8..11c6291 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,30 +1,30 @@ -import { initialize, enable } from "@electron/remote/main"; +import { enable, initialize } from "@electron/remote/main"; import { - app, BrowserWindow, + app, components, globalShortcut, ipcMain, protocol, session, } from "electron"; +import path from "path"; +import flagValues from "./constants/flags"; +import globalEvents from "./constants/globalEvents"; +import mediaKeys from "./constants/mediaKeys"; +import discordModule from "./scripts/discord"; +import { startExpress } from "./scripts/express"; +import mediaInfoModule from "./scripts/mediaInfo"; +import { addMenu } from "./scripts/menu"; import { - settings, - store, - createSettingsWindow, - showSettingsWindow, closeSettingsWindow, + createSettingsWindow, hideSettingsWindow, + settings, + showSettingsWindow, + store, } from "./scripts/settings"; import { addTray, refreshTray } from "./scripts/tray"; -import { addMenu } from "./scripts/menu"; -import path from "path"; -import { startExpress } from "./scripts/express"; -import mediaKeys from "./constants/mediaKeys"; -import mediaInfoModule from "./scripts/mediaInfo"; -import discordModule from "./scripts/discord"; -import globalEvents from "./constants/globalEvents"; -import flagValues from "./constants/flags"; const tidalUrl = "https://listen.tidal.com"; initialize(); diff --git a/src/preload.ts b/src/preload.ts index 403c84d..7bf5e3d 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -1,14 +1,14 @@ import { Notification, app, dialog } from "@electron/remote"; import { ipcRenderer } from "electron"; +import globalEvents from "./constants/globalEvents"; +import { customCSS, skipArtists, updateFrequency } from "./constants/settings"; +import statuses from "./constants/statuses"; import { Options } from "./models/options"; import { downloadFile } from "./scripts/download"; import { addHotkey } from "./scripts/hotkeys"; +import { settings, store } from "./scripts/settings"; import { setTitle } from "./scripts/window-functions"; -const { store, settings } = require("./scripts/settings"); const notificationPath = `${app.getPath("userData")}/notification.jpg`; -const statuses = require("./constants/statuses"); -const globalEvents = require("./constants/globalEvents"); -const { skipArtists, updateFrequency, customCSS } = require("./constants/settings"); const appName = "Tidal Hifi"; let currentSong = ""; let player: any; @@ -156,7 +156,7 @@ function addCustomCss() { * make sure it returns a number, if not use the default */ function getUpdateFrequency() { - const storeValue = store.get(updateFrequency); + const storeValue = store.get(updateFrequency) as number; const defaultValue = 500; if (!isNaN(storeValue)) { diff --git a/src/scripts/tray.ts b/src/scripts/tray.ts index fcdabab..07e3a59 100644 --- a/src/scripts/tray.ts +++ b/src/scripts/tray.ts @@ -1,6 +1,5 @@ import { BrowserWindow, Tray } from "electron"; - -const { getMenu } = require("./menu"); +import { getMenu } from "./menu"; let tray: Tray;