feat: check if downloading data exists

This commit is contained in:
Hachi-R 2024-11-06 19:29:51 -03:00
parent f555890b4c
commit 5d59a15bbf

View file

@ -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", {