import ElectronStore from "electron-store" ; import { update as updateAutoLaunch } from "./launchManager" ; import { platform } from "os" ; import { info } from "../util/debug" ; import ExtensionSettings from "../../@types/PreMiD/ExtensionSettings" ; import { trayManager } from ".." ; export let settings = new ElectronStore ( { defaults : { autoLaunch : true } } ) ; param extensionSettings export function update ( extensionSettings ) { info ( "Updated settings" ) ; if ( ! extensionSettings . titleMenubar && platform ( ) === "darwin" ) trayManager . tray . setTitle ( "" ) ; if ( settings . get ( "autoLaunch" ) != extensionSettings . autoLaunch ) { settings . set ( "autoLaunch" , extensionSettings . autoLaunch ) ; updateAutoLaunch ( ) ; } }