mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
Merge pull request #539 from Zagrios/chore/update-to-electron-31
[chore] update to electron 31 + update deps
This commit is contained in:
@@ -16,7 +16,7 @@ ipc.on("import-version", (args, reply) => {
|
||||
|
||||
ipc.on("bs-download.installation-folder", (_, reply) => {
|
||||
const installLocation = InstallationLocationService.getInstance();
|
||||
reply(from(installLocation.installationDirectory()));
|
||||
reply(of(installLocation.installationDirectory()));
|
||||
});
|
||||
|
||||
ipc.on("bs-download.set-installation-folder", (args, reply) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { writeFileSync } from "fs-extra";
|
||||
import { pathExistsSync, readFileSync, writeFileSync } from "fs-extra";
|
||||
import { tryit } from "shared/helpers/error.helpers";
|
||||
import log from "electron-log";
|
||||
import { Subject, debounceTime } from "rxjs";
|
||||
@@ -22,9 +22,13 @@ export class JsonCache<T = unknown> {
|
||||
|
||||
private load(): void {
|
||||
try {
|
||||
this._cache = require(this.jsonPath);
|
||||
if(pathExistsSync(this.jsonPath)){
|
||||
this._cache = JSON.parse(readFileSync(this.jsonPath).toString());
|
||||
} else {
|
||||
log.warn("File cache not exist yet", this.jsonPath);
|
||||
}
|
||||
} catch (error) {
|
||||
log.warn("Failed to load cache or file cache not exist yet", this.jsonPath, error);
|
||||
log.warn("Failed to load cache file", this.jsonPath, error);
|
||||
} finally {
|
||||
this._cache ??= {};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import log from "electron-log";
|
||||
export class UtilsService {
|
||||
private static instance: UtilsService;
|
||||
|
||||
private assetsPath: string = app.isPackaged ? path.join(process.resourcesPath, "assets") : path.join(__dirname, "../../../assets");
|
||||
private assetsPath: string = app.isPackaged ? path.join(process.resourcesPath, "assets") : path.join(__dirname, "../../assets");
|
||||
|
||||
private constructor() {}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { isValidUrl } from "../../shared/helpers/url.helpers";
|
||||
export class WindowManagerService {
|
||||
private static instance: WindowManagerService;
|
||||
|
||||
private readonly PRELOAD_PATH = app.isPackaged ? path.join(__dirname, "preload.js") : path.join(__dirname, "../../../.erb/dll/preload.js");
|
||||
private readonly PRELOAD_PATH = app.isPackaged ? path.join(__dirname, "preload.js") : path.join(__dirname, "../../.erb/dll/preload.js");
|
||||
private readonly IS_DEBUG = process.env.NODE_ENV === "development" || process.env.DEBUG_PROD === "true"
|
||||
|
||||
private readonly utilsService: UtilsService = UtilsService.getInstance();
|
||||
|
||||
@@ -44,7 +44,7 @@ export function NavBar() {
|
||||
return (
|
||||
<nav id="nav-bar" className="z-10 flex flex-col h-full max-h-full items-center p-1">
|
||||
<BsManagerIcon className="relative aspect-square w-16 h-16 mb-3" />
|
||||
<ol id="versions" className="w-fit max-w-[150px] relative left-[2px] grow overflow-y-hidden scrollbar-track-transparent scrollbar-default hover:overflow-y-scroll">
|
||||
<ol id="versions" className="w-fit max-w-[150px] relative left-[2px] grow overflow-y-hidden scrollbar-default hover:overflow-y-scroll">
|
||||
<NavBarItem isActive={route === "/shared"}>
|
||||
<SharedNavBarItem />
|
||||
</NavBarItem>
|
||||
|
||||
@@ -186,7 +186,7 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion;
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<div className="grow overflow-scroll w-full min-h-0 scrollbar-thin scrollbar-thumb-neutral-900 scrollbar-thumb-rounded-full">
|
||||
<div className="grow overflow-y-scroll w-full min-h-0 scrollbar-default">
|
||||
<ModsGrid modsMap={modsAvailable} installed={modsInstalled} modsSelected={modsSelected} onModChange={handleModChange} moreInfoMod={moreInfoMod} onWantInfos={handleMoreInfo} />
|
||||
</div>
|
||||
<div className="h-10 shrink-0 flex items-center justify-between px-3">
|
||||
|
||||
+15
-4
@@ -79,10 +79,21 @@
|
||||
}
|
||||
|
||||
.scrollbar-default {
|
||||
/* scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 */
|
||||
@apply scrollbar-thin;
|
||||
@apply scrollbar-thumb-rounded-full;
|
||||
@apply scrollbar-thumb-neutral-900;
|
||||
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background-color: rgb(23 23 23 / var(--tw-bg-opacity));
|
||||
border-radius: 999px;
|
||||
}
|
||||
}
|
||||
|
||||
.tippy-box[data-theme~='default'] {
|
||||
|
||||
@@ -113,7 +113,10 @@ export function SettingsPage() {
|
||||
};
|
||||
|
||||
const loadInstallationFolder = () => {
|
||||
steamDownloader.getInstallationFolder().then(res => setInstallationFolder(res));
|
||||
steamDownloader.getInstallationFolder().then(res => {
|
||||
console.log("AAAAA", res);
|
||||
setInstallationFolder(res);
|
||||
});
|
||||
};
|
||||
|
||||
const loadDownloadersSession = () => {
|
||||
|
||||
@@ -62,7 +62,7 @@ export default function OneClickDownloadPlaylist() {
|
||||
<TitleBar template="oneclick-download-playlist.html" />
|
||||
<BsmImage className="mt-2 aspect-square w-1/2 object-cover rounded-md shadow-black shadow-lg" placeholder={defaultImage} image={playlistImage()} errorImage={defaultImage} />
|
||||
<h1 className="mt-4 overflow-hidden font-bold italic text-xl text-gray-200 tracking-wide w-full text-center whitespace-nowrap text-ellipsis px-2">{playlistInfos?.playlistTitle}</h1>
|
||||
<div className="w-full py-3 flex items-center justify-center max-w-full overflow-x-scroll overflow-y-hidden scrollbar scrollbar-thin scrollbar-track-transparent scrollbar-thumb-neutral-900" ref={mapsContainer}>
|
||||
<div className="w-full py-3 flex items-center justify-center max-w-full overflow-x-scroll overflow-y-hidden scrollbar-default" ref={mapsContainer}>
|
||||
<div className="flex justify-start items-start gap-2.5">{downloadedMaps?.map(map => map?.coverUrl &&
|
||||
<motion.img layout="position" key={map.hash} className="block aspect-square w-14 object-cover rounded-md shadow-black shadow-md" src={map?.coverUrl} initial={{ scale: 0 }} animate={{ scale: 1 }} whileHover={{ rotate: 5 }} />
|
||||
)}</div>
|
||||
|
||||
Reference in New Issue
Block a user