| 429 | } |
| 430 | |
| 431 | void FileRequestAsync::DownloadDone(bool success) { |
| 432 | if (IsReady()) { |
| 433 | // Change to real success state when already finished before |
| 434 | success = state == State_DoneSuccess; |
| 435 | } |
| 436 | |
| 437 | if (success) { |
| 438 | #ifdef EMSCRIPTEN |
| 439 | if (state == State_Pending) { |
| 440 | // Update directory structure (new file was added) |
| 441 | if (FileFinder::Game()) { |
| 442 | FileFinder::Game().ClearCache(); |
| 443 | } |
| 444 | } |
| 445 | #endif |
| 446 | |
| 447 | state = State_DoneSuccess; |
| 448 | |
| 449 | CallListeners(true); |
| 450 | } |
| 451 | else { |
| 452 | state = State_DoneFailure; |
| 453 | |
| 454 | CallListeners(false); |
| 455 | } |
| 456 | } |
no test coverage detected