From 222d7eb74410c07ecbbd66279ef84156b227f560 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Fri, 23 Oct 2026 14:13:06 -0700 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20show=20items=20added=20elsewh?= =?UTF-8?q?ere=20while=20New=20=E2=80=BA=20Web=20Link=20prompts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The New menu's create wrapper suppressed item.added for as long as it ran, which for Web Link includes its URL prompt, so files added to the folder meanwhile never appeared. It now counts only from the actual create. A create that fails now says so instead of failing silently. --- src/gui/src/UI/Dashboard/TabFiles.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/src/UI/Dashboard/TabFiles.js b/src/gui/src/UI/Dashboard/TabFiles.js index aeede8b73..17235e9a9 100644 --- a/src/gui/src/UI/Dashboard/TabFiles.js +++ b/src/gui/src/UI/Dashboard/TabFiles.js @@ -4553,15 +4553,20 @@ const TabFiles = { const wrapWithDashboardRename = (originalOnClick) => { return async () => { $('.context-menu').remove(); - _this._creatingItem++; // Temporarily intercept create_file to capture the upload promise let uploadPromise = null; const origCreateFile = window.create_file; window.create_file = (options) => { + // Counted from here, not from the click: Web Link + // waits on a prompt first, and other items added + // to the folder meanwhile must still show up. + _this._creatingItem++; const content = options.content ? [options.content] : []; uploadPromise = puter.fs.upload(new File(content, options.name), options.dirname); - return uploadPromise; + // A failure is reported once, below, not again by + // a caller that awaits this. + return uploadPromise.catch(() => undefined); }; try { @@ -4598,10 +4603,10 @@ const TabFiles = { } } } catch ( err ) { - // File creation failed silently + UIAlert(err?.message ?? String(err)); } finally { window.create_file = origCreateFile; - _this._creatingItem--; + if ( uploadPromise ) _this._creatingItem--; } }; };