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() {
|
public static async getStatus() {
|
||||||
const response = await this.rpc.get<LibtorrentPayload | null>("/status");
|
const response = await this.rpc.get<LibtorrentPayload | null>("/status");
|
||||||
if (response.data?.downloading === null) return null;
|
|
||||||
|
|
||||||
|
if (response.data?.downloading) {
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
progress,
|
progress,
|
||||||
|
@ -81,7 +81,7 @@ export class PythonInstance {
|
||||||
folderName,
|
folderName,
|
||||||
status,
|
status,
|
||||||
gameId,
|
gameId,
|
||||||
} = response.data?.downloading!;
|
} = response.data.downloading;
|
||||||
|
|
||||||
this.downloadingGameId = gameId;
|
this.downloadingGameId = gameId;
|
||||||
|
|
||||||
|
@ -130,6 +130,9 @@ export class PythonInstance {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
static async pauseDownload() {
|
static async pauseDownload() {
|
||||||
await this.rpc
|
await this.rpc
|
||||||
.post("/action", {
|
.post("/action", {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue