mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
refactor: change game delete to soft delete
This commit is contained in:
parent
8343b66d67
commit
797f5ee0d8
17 changed files with 115 additions and 44 deletions
|
|
@ -57,8 +57,8 @@ export function useDownload() {
|
|||
deleteGame(gameId);
|
||||
});
|
||||
|
||||
const removeGame = (gameId: number) =>
|
||||
window.electron.removeGame(gameId).then(() => {
|
||||
const removeGameFromDownload = (gameId: number) =>
|
||||
window.electron.removeGameFromDownload(gameId).then(() => {
|
||||
updateLibrary();
|
||||
});
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ export function useDownload() {
|
|||
pauseDownload,
|
||||
resumeDownload,
|
||||
cancelDownload,
|
||||
removeGame,
|
||||
removeGameFromDownload,
|
||||
deleteGame,
|
||||
isGameDeleting,
|
||||
clearDownload: () => dispatch(clearDownload()),
|
||||
|
|
|
|||
|
|
@ -12,5 +12,10 @@ export function useLibrary() {
|
|||
.then((updatedLibrary) => dispatch(setLibrary(updatedLibrary)));
|
||||
}, [dispatch]);
|
||||
|
||||
return { library, updateLibrary };
|
||||
const removeGameFromLibrary = (gameId: number) =>
|
||||
window.electron.removeGameFromLibrary(gameId).then(() => {
|
||||
updateLibrary();
|
||||
});
|
||||
|
||||
return { library, updateLibrary, removeGameFromLibrary };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue