Skip to content

Commit 6b7de76

Browse files
committed
test
1 parent 7bc5c52 commit 6b7de76

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

docs/converted/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

docs/js/main.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,32 @@ async function updateFileList() {
186186
}
187187
});
188188

189+
if (response.status === 404) {
190+
// Directory doesn't exist yet, this is normal for new repositories
191+
fileList.innerHTML = '<li class="list-group-item text-muted">No converted files available yet</li>';
192+
return;
193+
}
194+
189195
if (!response.ok) {
190-
throw new Error('Failed to fetch file list');
196+
throw new Error(`Failed to fetch file list: ${response.statusText}`);
191197
}
192198

193199
const files = await response.json();
194200
renderFileList(files);
195201
} catch (error) {
196202
console.error('Error updating file list:', error);
197-
showStatus('Error loading file list', 'danger');
203+
if (error.message.includes('404')) {
204+
fileList.innerHTML = '<li class="list-group-item text-muted">No converted files available yet</li>';
205+
} else {
206+
showStatus('Error loading file list: ' + error.message, 'warning');
207+
}
198208
}
199209
}
200210

201211
function renderFileList(files) {
202212
fileList.innerHTML = '';
203-
if (!Array.isArray(files)) {
204-
showStatus('No converted files available yet', 'info');
213+
if (!Array.isArray(files) || files.length === 0) {
214+
fileList.innerHTML = '<li class="list-group-item text-muted">No converted files available yet</li>';
205215
return;
206216
}
207217

uploads/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)