Skip to content

Commit

Permalink
Merge pull request #162 from makermelissa/main
Browse files Browse the repository at this point in the history
Fix file listing for CP 9
  • Loading branch information
makermelissa authored Feb 21, 2024
2 parents cc2603d + 5833721 commit 1780d47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ <h1>Select USB Host Folder</h1>
<tbody>
<tr>
<td>Board:</td>
<td><a id="board"></a></td>
<td><a id="board" target="_blank"></a></td>
</tr>
<tr>
<td>Version:</td>
Expand Down
14 changes: 9 additions & 5 deletions js/common/web-file-transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,16 @@ class FileTransferClient {

const response = await this._fetch(`/fs${path}`, {headers: {"Accept": "application/json"}});
const results = await response.json();
for (let result of results) {
let listings = results
if (results.files !== undefined) {
listings = results.files;
}
for (let listing of listings) {
contents.push({
path: result.name,
isDir: result.directory,
fileSize: result.file_size,
fileDate: Number(result.modified_ns / 1000000),
path: listing.name,
isDir: listing.directory,
fileSize: listing.file_size,
fileDate: Number(listing.modified_ns / 1000000),
});
}

Expand Down

0 comments on commit 1780d47

Please sign in to comment.