mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-26 16:07:13 +00:00
fix: show a message instead of a blank pane when a Dashboard folder fails to open
renderDirectory empties the file list before awaiting readdir, so a readdir rejection (permission lost, folder deleted from another session, network error) left a completely blank pane with only a console error. Render a centered "This folder couldn't be opened." message on the catch path. Verified live: a simulated readdir failure shows the message, clears the spinner, and leaves navigation working (next folder loads).
This commit is contained in:
@@ -1855,6 +1855,21 @@ const TabFiles = {
|
||||
// network). Without this, renderingDirectory would stay true and
|
||||
// the guard above would block all further navigation.
|
||||
console.error('Failed to read directory:', err);
|
||||
// The container was already emptied above; show a message instead of
|
||||
// leaving a blank pane with no explanation.
|
||||
this.$el_window.find('.files-tab .files').html(`<div style="
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
pointer-events: none;
|
||||
text-align: center;
|
||||
padding: 0 16px;
|
||||
">This folder couldn't be opened.</div>`);
|
||||
this.hideSpinner();
|
||||
this.renderingDirectory = false;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user