fix: Promise rendering in flows view addFooter
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 <noreply@anthropic.com>
This commit is contained in:
parent
f65bc8c4ca
commit
b946279106
@ -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] || {};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user