FlowFuse / FlowFuse/node-red-dashboard
NodeRED Restart Required When Changing Name or App Icon
- Dominant language
- HTML
- Stars
- 355
- Forks
- 82
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 24
Description
### Current Behavior
NodeRED needs to be restarted for name or app icon changes to take effect, seemingly due to the following:
`init` function gets executed on every deploy but anything inside `if (!uiShared.app) {}` only on initial Dashboard start.
```js
function init(node, config) {
node.uiShared = uiShared
// ...
if (!uiShared.app) {
// ...
uiShared.app.get('/dashboard/manifest.webmanifest', (req, res) => {
const hasAppIcon = (config.appIcon && config.appIcon.trim() !== '')
const manifest = {
name: config.name,
short_name: config.name,
start_url: './',
display: 'standalone',
background_color: '#ffffff',
lang: 'en',
scope: './',
description: config.name,
theme_color: '#ffffff',
icons: [
{ src: hasAppIcon ? config.appIcon : 'pwa-64x64.png', sizes: '64x64', type: 'image/png' },
{ src: hasAppIcon ? config.appIcon : 'pwa-192x192.png', sizes: '192x192', type: 'image/png' },
{ src: hasAppIcon ? config.appIcon : 'pwa-512x512.png', sizes: '512x512', type: 'image/png' },
{ src: hasAppIcon ? config.appIcon : 'pwa-512x512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' }
]
}
return res.json(manifest)
})
}
// ...
}
```
### Expected Behavior
Name and app icon should be updated after deploying - possible workaround to avoid expensive full reinitializations on every deploy would be to add a manual reload button in `ui-base` settings.
### Steps To Reproduce
1. Deploy flow with D2.
2. Observe app name or icon when pressing Install (PWA).
3. Change app name or icon in ui-config settings and deploy.
4. Reload page (several times for good measure) and observe app name or icon when pressing Install (PWA). Changes do not update.
5. After a NodeRED restart the above procedure will result in correctly updated changes.
### Environment
- Dashboard version: 1.19.1
- Node-RED version: 4.0.2
- Node.js version:
- npm version:
- Platform/OS: Any
- Browser: Any
### Have you provided an initial effort estimate for this issue?
I am not a FlowFuse team member
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.