mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +03:00
chore: level as external dep
This commit is contained in:
parent
0f0a67b55e
commit
71cb4cd240
@ -18,7 +18,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
build: {
|
build: {
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ["better-sqlite3"],
|
external: ["better-sqlite3", "level"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
|
@ -13,7 +13,7 @@ const getGameByObjectId = async (
|
|||||||
downloadsSublevel.get(gameKey),
|
downloadsSublevel.get(gameKey),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!game) return null;
|
if (!game || game.isDeleted) return null;
|
||||||
|
|
||||||
return { id: gameKey, ...game, download };
|
return { id: gameKey, ...game, download };
|
||||||
};
|
};
|
||||||
|
@ -152,7 +152,13 @@ export class DownloadManager {
|
|||||||
.values()
|
.values()
|
||||||
.all()
|
.all()
|
||||||
.then((games) => {
|
.then((games) => {
|
||||||
return sortBy(games, "timestamp", "DESC");
|
return sortBy(
|
||||||
|
games.filter(
|
||||||
|
(game) => !["complete", "seeding"].includes(game.status!)
|
||||||
|
),
|
||||||
|
"timestamp",
|
||||||
|
"DESC"
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const [nextItemOnQueue] = downloads;
|
const [nextItemOnQueue] = downloads;
|
||||||
|
@ -128,9 +128,8 @@ export function Sidebar() {
|
|||||||
if (game.download?.status === "paused")
|
if (game.download?.status === "paused")
|
||||||
return t("paused", { title: game.title });
|
return t("paused", { title: game.title });
|
||||||
|
|
||||||
if (game.download) {
|
if (game.download?.status === "active")
|
||||||
return t("queued", { title: game.title });
|
return t("queued", { title: game.title });
|
||||||
}
|
|
||||||
|
|
||||||
return game.title;
|
return game.title;
|
||||||
};
|
};
|
||||||
|
@ -81,7 +81,7 @@ export function GameDetailsContextProvider({
|
|||||||
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [gameColor, setGameColor] = useState("");
|
const [gameColor, setGameColor] = useState("");
|
||||||
const [isGameRunning, setisGameRunning] = useState(false);
|
const [isGameRunning, setIsGameRunning] = useState(false);
|
||||||
const [showRepacksModal, setShowRepacksModal] = useState(false);
|
const [showRepacksModal, setShowRepacksModal] = useState(false);
|
||||||
const [showGameOptionsModal, setShowGameOptionsModal] = useState(false);
|
const [showGameOptionsModal, setShowGameOptionsModal] = useState(false);
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ export function GameDetailsContextProvider({
|
|||||||
setShopDetails(null);
|
setShopDetails(null);
|
||||||
setGame(null);
|
setGame(null);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
setisGameRunning(false);
|
setIsGameRunning(false);
|
||||||
setAchievements(null);
|
setAchievements(null);
|
||||||
dispatch(setHeaderTitle(gameTitle));
|
dispatch(setHeaderTitle(gameTitle));
|
||||||
}, [objectId, gameTitle, dispatch]);
|
}, [objectId, gameTitle, dispatch]);
|
||||||
@ -183,8 +183,9 @@ export function GameDetailsContextProvider({
|
|||||||
updateGame();
|
updateGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
setisGameRunning(updatedIsGameRunning);
|
setIsGameRunning(updatedIsGameRunning);
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
unsubscribe();
|
unsubscribe();
|
||||||
};
|
};
|
||||||
|
1
src/renderer/src/declaration.d.ts
vendored
1
src/renderer/src/declaration.d.ts
vendored
@ -27,6 +27,7 @@ import type {
|
|||||||
ComparedAchievements,
|
ComparedAchievements,
|
||||||
CatalogueSearchPayload,
|
CatalogueSearchPayload,
|
||||||
LibraryGame,
|
LibraryGame,
|
||||||
|
GameRunning,
|
||||||
} from "@types";
|
} from "@types";
|
||||||
import type { AxiosProgressEvent } from "axios";
|
import type { AxiosProgressEvent } from "axios";
|
||||||
import type disk from "diskusage";
|
import type disk from "diskusage";
|
||||||
|
@ -212,7 +212,6 @@ export function Sidebar() {
|
|||||||
))}
|
))}
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
style={{ textAlign: "center" }}
|
|
||||||
to={buildGameAchievementPath({
|
to={buildGameAchievementPath({
|
||||||
shop: shop,
|
shop: shop,
|
||||||
objectId: objectId!,
|
objectId: objectId!,
|
||||||
|
Loading…
Reference in New Issue
Block a user