mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-28 13:21:02 +00:00
feat: added helper functions to the game status to keep it simple to read.
This commit is contained in:
@@ -7,4 +7,20 @@ export enum GameStatus {
|
||||
Cancelled = "cancelled",
|
||||
Finished = "finished",
|
||||
Decompressing = "decompressing",
|
||||
}
|
||||
|
||||
export namespace GameStatus {
|
||||
export const isDownloading = (status: GameStatus | "") =>
|
||||
status === GameStatus.Downloading ||
|
||||
status === GameStatus.DownloadingMetadata ||
|
||||
status === GameStatus.CheckingFiles;
|
||||
|
||||
export const isVerifying = (status: GameStatus | "") =>
|
||||
GameStatus.DownloadingMetadata == status ||
|
||||
GameStatus.CheckingFiles == status ||
|
||||
GameStatus.Decompressing == status;
|
||||
|
||||
export const isReady = (status: GameStatus | "") =>
|
||||
status === GameStatus.Finished ||
|
||||
status === GameStatus.Seeding;
|
||||
}
|
||||
Reference in New Issue
Block a user