Skip to content

Commit

Permalink
chore: level as external dep
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrannychaseroperation committed Jan 22, 2025
1 parent 0f0a67b commit 71cb4cd
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineConfig(({ mode }) => {
build: {
sourcemap: true,
rollupOptions: {
external: ["better-sqlite3"],
external: ["better-sqlite3", "level"],
},
},
resolve: {
Expand Down
2 changes: 1 addition & 1 deletion src/main/events/library/get-game-by-object-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const getGameByObjectId = async (
downloadsSublevel.get(gameKey),
]);

if (!game) return null;
if (!game || game.isDeleted) return null;

return { id: gameKey, ...game, download };
};
Expand Down
8 changes: 7 additions & 1 deletion src/main/services/download/download-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ export class DownloadManager {
.values()
.all()
.then((games) => {
return sortBy(games, "timestamp", "DESC");
return sortBy(
games.filter(
(game) => !["complete", "seeding"].includes(game.status!)
),
"timestamp",
"DESC"
);
});

const [nextItemOnQueue] = downloads;
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ export function Sidebar() {
if (game.download?.status === "paused")
return t("paused", { title: game.title });

if (game.download) {
if (game.download?.status === "active")
return t("queued", { title: game.title });
}

return game.title;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function GameDetailsContextProvider({

const [isLoading, setIsLoading] = useState(false);
const [gameColor, setGameColor] = useState("");
const [isGameRunning, setisGameRunning] = useState(false);
const [isGameRunning, setIsGameRunning] = useState(false);
const [showRepacksModal, setShowRepacksModal] = useState(false);
const [showGameOptionsModal, setShowGameOptionsModal] = useState(false);

Expand Down Expand Up @@ -168,7 +168,7 @@ export function GameDetailsContextProvider({
setShopDetails(null);
setGame(null);
setIsLoading(true);
setisGameRunning(false);
setIsGameRunning(false);
setAchievements(null);
dispatch(setHeaderTitle(gameTitle));
}, [objectId, gameTitle, dispatch]);
Expand All @@ -183,8 +183,9 @@ export function GameDetailsContextProvider({
updateGame();
}

setisGameRunning(updatedIsGameRunning);
setIsGameRunning(updatedIsGameRunning);
});

return () => {
unsubscribe();
};
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/declaration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import type {
ComparedAchievements,
CatalogueSearchPayload,
LibraryGame,
GameRunning,
} from "@types";
import type { AxiosProgressEvent } from "axios";
import type disk from "diskusage";
Expand Down
1 change: 0 additions & 1 deletion src/renderer/src/pages/game-details/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ export function Sidebar() {
))}

<Link
style={{ textAlign: "center" }}
to={buildGameAchievementPath({
shop: shop,
objectId: objectId!,
Expand Down

0 comments on commit 71cb4cd

Please sign in to comment.