mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: check if downloading data exists
This commit is contained in:
parent
f555890b4c
commit
5d59a15bbf
1 changed files with 59 additions and 56 deletions
|
@ -68,8 +68,8 @@ export class PythonInstance {
|
|||
|
||||
public static async getStatus() {
|
||||
const response = await this.rpc.get<LibtorrentPayload | null>("/status");
|
||||
if (response.data?.downloading === null) return null;
|
||||
|
||||
if (response.data?.downloading) {
|
||||
try {
|
||||
const {
|
||||
progress,
|
||||
|
@ -81,7 +81,7 @@ export class PythonInstance {
|
|||
folderName,
|
||||
status,
|
||||
gameId,
|
||||
} = response.data?.downloading!;
|
||||
} = response.data.downloading;
|
||||
|
||||
this.downloadingGameId = gameId;
|
||||
|
||||
|
@ -130,6 +130,9 @@ export class PythonInstance {
|
|||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static async pauseDownload() {
|
||||
await this.rpc
|
||||
.post("/action", {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue