From b94627910637a00be6558c7bf9a7d1dfca49b92c Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Tue, 6 Jan 2026 19:20:07 +0100 Subject: [PATCH] fix: Promise rendering in flows view addFooter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed "[object Promise]" display bug in the flows view. ## Problem: - Flows view was showing "[object Promise]" text on the page - Root cause: The `addFooter()` function was returning a Promise - LuCI calls `addFooter()` synchronously and expects it to return nothing or DOM elements - When a Promise is returned, LuCI tries to render it as text, showing "[object Promise]" ## Solution: Changed from: ```javascript addFooter: function() { return Promise.all([...]).then(...); } ``` To: ```javascript addFooter: function() { Promise.all([...]).then(...); // Execute but don't return } ``` ## Technical Details: - The `addFooter()` hook is called after `render()` for post-render initialization - It should perform async operations but not return promises - The promise still executes and populates the containers correctly - Only the return value was changed (removed the `return` keyword) ## Testing: - Deployed to router - Flows view now displays correctly without "[object Promise]" - Initial data loading works properly - Polling continues to update data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../luci-static/resources/view/secubox-netifyd/flows.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/secubox/luci-app-secubox-netifyd/htdocs/luci-static/resources/view/secubox-netifyd/flows.js b/package/secubox/luci-app-secubox-netifyd/htdocs/luci-static/resources/view/secubox-netifyd/flows.js index 189a7526..570b33b9 100644 --- a/package/secubox/luci-app-secubox-netifyd/htdocs/luci-static/resources/view/secubox-netifyd/flows.js +++ b/package/secubox/luci-app-secubox-netifyd/htdocs/luci-static/resources/view/secubox-netifyd/flows.js @@ -383,8 +383,8 @@ return view.extend({ }, addFooter: function() { - // Initial render - return Promise.all([ + // Initial render - execute promise but don't return it + Promise.all([ netifydAPI.getDashboard() ]).then(L.bind(function(result) { var dashboard = result[0] || {};