@@ -14,6 +14,7 @@ import DMQueueState from 'frontend/state/DMQueueState'
14
14
import { isNotNative } from 'frontend/helpers/library'
15
15
import { hasProgress } from 'frontend/hooks/hasProgress'
16
16
import { useGameInfo } from 'frontend/hooks/useGameInfo'
17
+ import { useEstimatedUncompressedSize } from 'frontend/hooks/useEstimatedUncompressedSize'
17
18
18
19
export default function DownloadToastManager ( ) {
19
20
const [ latestElement , setLatestElement ] = useState < DMQueueElement > ( )
@@ -37,6 +38,7 @@ export default function DownloadToastManager() {
37
38
const installedPlatform = currentElement ?. params . platformToInstall
38
39
const isExtracting = status === 'extracting'
39
40
const isPatching = status === 'patching'
41
+ const isInstalling = status === 'installing'
40
42
const { progress, etaInMs } = hasProgress ( appName , isExtracting )
41
43
42
44
let showPlayTimeout : NodeJS . Timeout | undefined = undefined
@@ -160,10 +162,16 @@ export default function DownloadToastManager() {
160
162
return 'inProgress'
161
163
}
162
164
165
+ const uncompressedSize = useEstimatedUncompressedSize (
166
+ platform ,
167
+ installInfo ?. manifest ?. disk_size || 0 ,
168
+ installInfo ?. manifest ?. download_size || 0
169
+ )
170
+
163
171
let adjustedDownloadedInBytes = downloadedMB * 1024 * 1024
164
- const adjustedDownloadSizeInBytes = isExtracting
165
- ? installInfo ?. manifest . disk_size || 0
166
- : installInfo ?. manifest . download_size || 0
172
+ const adjustedDownloadSizeInBytes = isInstalling
173
+ ? installInfo ?. manifest . download_size || 0
174
+ : uncompressedSize
167
175
168
176
if ( isExtracting ) {
169
177
if ( adjustedDownloadedInBytes > adjustedDownloadSizeInBytes ) {
0 commit comments