mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03:32:13 +00:00
feat: adding link to game running
This commit is contained in:
parent
8afb3c27dc
commit
2f4d1396a9
3 changed files with 26 additions and 19 deletions
|
@ -4,8 +4,8 @@ import { dataSource } from "@main/data-source";
|
||||||
import { DownloadQueue, Game, UserAuth } from "@main/entity";
|
import { DownloadQueue, Game, UserAuth } from "@main/entity";
|
||||||
|
|
||||||
const signOut = async (_event: Electron.IpcMainInvokeEvent) => {
|
const signOut = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||||
const databaseOperations = dataSource.transaction(
|
const databaseOperations = dataSource
|
||||||
async (transactionalEntityManager) => {
|
.transaction(async (transactionalEntityManager) => {
|
||||||
await transactionalEntityManager.getRepository(DownloadQueue).delete({});
|
await transactionalEntityManager.getRepository(DownloadQueue).delete({});
|
||||||
|
|
||||||
await transactionalEntityManager.getRepository(Game).delete({});
|
await transactionalEntityManager.getRepository(Game).delete({});
|
||||||
|
@ -13,11 +13,11 @@ const signOut = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||||
await transactionalEntityManager
|
await transactionalEntityManager
|
||||||
.getRepository(UserAuth)
|
.getRepository(UserAuth)
|
||||||
.delete({ id: 1 });
|
.delete({ id: 1 });
|
||||||
}
|
})
|
||||||
);
|
.then(() => {
|
||||||
|
/* Removes all games being played */
|
||||||
/* Removes all games being played */
|
gamesPlaytime.clear();
|
||||||
gamesPlaytime.clear();
|
});
|
||||||
|
|
||||||
/* Disconnects aria2 */
|
/* Disconnects aria2 */
|
||||||
DownloadManager.disconnect();
|
DownloadManager.disconnect();
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { buildGameDetailsPath, steamUrlBuilder } from "@renderer/helpers";
|
import { buildGameDetailsPath, steamUrlBuilder } from "@renderer/helpers";
|
||||||
import { PersonIcon, TelescopeIcon } from "@primer/octicons-react";
|
import { PersonIcon, TelescopeIcon } from "@primer/octicons-react";
|
||||||
import { Button } from "@renderer/components";
|
import { Button, Link } from "@renderer/components";
|
||||||
import { UserEditProfileModal } from "./user-edit-modal";
|
import { UserEditProfileModal } from "./user-edit-modal";
|
||||||
import { UserSignOutModal } from "./user-signout-modal";
|
import { UserSignOutModal } from "./user-signout-modal";
|
||||||
|
|
||||||
|
@ -114,16 +114,11 @@ export function UserContent({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{gameRunning && isMe && (
|
{gameRunning && isMe && (
|
||||||
<div
|
<img
|
||||||
style={{
|
src={steamUrlBuilder.libraryHero(gameRunning.objectID)}
|
||||||
backgroundImage: `url(${steamUrlBuilder.libraryHero(gameRunning.objectID)})`,
|
alt={gameRunning.title}
|
||||||
backgroundPosition: "top",
|
className={styles.profileBackground}
|
||||||
position: "absolute",
|
/>
|
||||||
inset: 0,
|
|
||||||
backgroundSize: "cover",
|
|
||||||
borderRadius: "4px",
|
|
||||||
}}
|
|
||||||
></div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
@ -165,7 +160,9 @@ export function UserContent({
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<p>{gameRunning.title}</p>
|
<Link to={buildGameDetailsPath(gameRunning)}>
|
||||||
|
{gameRunning.title}
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
{t("playing_for", {
|
{t("playing_for", {
|
||||||
|
|
|
@ -205,3 +205,13 @@ export const signOutModalButtonsContainer = style({
|
||||||
gap: `${SPACING_UNIT}px`,
|
gap: `${SPACING_UNIT}px`,
|
||||||
paddingTop: `${SPACING_UNIT}px`,
|
paddingTop: `${SPACING_UNIT}px`,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const profileBackground = style({
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
position: "absolute",
|
||||||
|
objectFit: "cover",
|
||||||
|
left: "0",
|
||||||
|
top: "0",
|
||||||
|
borderRadius: "4px",
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue