diff --git a/App.razor b/App.razor
index 6c4ba83..33e5d3f 100644
--- a/App.razor
+++ b/App.razor
@@ -79,13 +79,18 @@
@if (compressionMode == CompressionMode.Compress)
{
-
+
}
else
{
-
+
}
- @if(!anyFiles){
+ @if (!IsFormatReady)
+ {
+
Loading Zstandard moduleā¦
+ }
+ else if (!anyFiles)
+ {
No files selected
}
@@ -134,6 +139,7 @@
private bool anyFiles;
private readonly Dictionary _formatUrls = new();
private Type? _zstdStreamFactory;
+ private bool IsFormatReady => _format != CompressionFormat.ZStd || _zstdStreamFactory is not null;
private const long WarnFileSizeBytes = 250L * 1024 * 1024;
private static readonly SemaphoreSlim _semaphore = new(4, 4);
diff --git a/e2e/live-tests/live.spec.js b/e2e/live-tests/live.spec.js
index 73ce5cd..24fd308 100644
--- a/e2e/live-tests/live.spec.js
+++ b/e2e/live-tests/live.spec.js
@@ -29,14 +29,18 @@ for (const format of formats) {
let downloadPromise = page.waitForEvent('download');
await page.locator('input[type="file"]').setInputFiles(inputPath);
- await page.getByRole('button', { name: 'Compress Files' }).click();
+ const compressButton = page.getByRole('button', { name: 'Compress Files' });
+ await expect(compressButton).toBeEnabled({ timeout: 30000 });
+ await compressButton.click();
const compressed = await downloadPromise;
await compressed.saveAs(compressedPath);
await page.locator('label[for="radio-decompress"]').click();
downloadPromise = page.waitForEvent('download');
await page.locator('input[type="file"]').setInputFiles(compressedPath);
- await page.getByRole('button', { name: 'Decompress Files' }).click();
+ const decompressButton = page.getByRole('button', { name: 'Decompress Files' });
+ await expect(decompressButton).toBeEnabled({ timeout: 30000 });
+ await decompressButton.click();
const decompressed = await downloadPromise;
expect(fs.readFileSync(await decompressed.path(), 'utf8')).toBe(content);
} finally {