Skip to content

Commit b70acb3

Browse files
committed
fix up storage screen
1 parent 5ffb6a7 commit b70acb3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/app/Flash.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ const errors = {
109109
hideRetry: true,
110110
},
111111
[ErrorCode.STORAGE_SPACE]: {
112-
description: 'Your system does not have enough space available to download AGNOS. Your browser may be restricting' +
112+
description: 'Your system does not have enough space available to download the OS images. Your browser may be restricting' +
113113
' the available space if you are in a private, incognito or guest session.',
114+
hideRetry: true,
114115
},
115116
[ErrorCode.UNRECOGNIZED_DEVICE]: {
116117
status: 'Unrecognized device',

src/utils/image.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { fetchStream } from './stream'
1111
* @returns {void}
1212
*/
1313

14-
const MIN_QUOTA_MB = 5250
14+
const MIN_QUOTA_GB = 5.25
1515

1616
export class ImageManager {
1717
/** @type {FileSystemDirectoryHandle} */
@@ -33,9 +33,9 @@ export class ImageManager {
3333
}
3434

3535
const estimate = await navigator.storage.estimate()
36-
const quotaMB = (estimate.quota || 0) / (1024 ** 2)
37-
if (quotaMB < MIN_QUOTA_MB) {
38-
throw new Error(`Not enough storage: ${quotaMB.toFixed(0)}MB free, need ${MIN_QUOTA_MB.toFixed(0)}MB`)
36+
const quotaGB = (estimate.quota || 0) / (1024 ** 3)
37+
if (quotaGB < MIN_QUOTA_GB) {
38+
throw new Error(`Not enough storage: ${quotaGB.toFixed(1)}GB free, need ${MIN_QUOTA_GB.toFixed(1)}GB`)
3939
}
4040
}
4141

0 commit comments

Comments
 (0)