-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab changes when PWA reconnects #1604
Comments
To clarify exactly what you mean by a Tab, have you got the layout set to Tabs for the page? |
Yes, I'm using numerous tabs on the page, as it's easier to navigate on a phone. |
Hi @Paul-Reed, I try to avoid to mention people as much as possible, but I know that @cgjgh has done quite a lot of great refactorings in those parts of the dashboard code. Perhaps he can can give us some ideas about what might cause your issue. |
@bartbutenaers I’m not aware of any part in the reloading mechanism that would specifically cause this, but will take a more in depth look.
I realize your frustration and my apologies for not being more active on here. At the moment any time I have goes into porting previous projects into D2, building 3rd party D2 nodes if needed. If an issue on here coincides with one I’m facing I do my best to address it. My hope is that everyone who raises an issue on here, also tries their best in contributing and finding the solution. |
@cgjgh thanks a lot to help Paul with this! Really appreciated!! I hope you are aware that I am not referring to you, when I am talking about the near-zero contribution rate in this repo... |
My contribution is unfortunately finding issues.. Thanks @bartbutenaers @cgjgh |
In fact this is nothing to do with PWA or mobile devices. It can very easily be seen on a PC if node-red is running on a different machine to that running the browser. Open the dashboard in the browser, select a tab other than the first, and disconnect the network from the machine running the browser. Wait a few seconds for the disconnected message, then reconnect the network. When it reconnects it reverts to showing the first tab. |
The issue does indeed seem to originate here in Tabs.vue rather than PWA related code. beforeRouteEnter (to, from, next) {
next(vm => {
// Select the first tabsheet every time the user arrives on this page
if (vm.orderedGroups && vm.orderedGroups.length > 0) {
vm.tab = 0
}
})
}, We could make a slight change and check if origin and destination pages are unique before assigning tab beforeRouteEnter (to, from, next) {
next(vm => {
// Select the first tabsheet every time the user arrives on this page
if (vm.orderedGroups && vm.orderedGroups.length > 0) {
// Check if origin and destination pages are unique
if (to?.name !== from?.name) {
vm.tab = 0
}
}
})
}, This seems to still satisfy the issue @bartbutenaers solved in #1552 and also fixes the one @Paul-Reed found. |
That fixes it for me. |
Where is |
@cgjgh |
It is |
@Paul-Reed, in case you didn't realise, you can't just hack this in the node_modules folder. You have to clone the dashboard repository, edit it, rebuild it, and install that version into your node-red. See https://dashboard.flowfuse.com/contributing/ |
Ah ok. It's my live server, so I'll wait for it to be merged. Thanks for the speedy fix @cgjgh |
If I navigate to a tab to perhaps monitor energy usage, my phone/tablet screen times out after 30 seconds, so I touch the screen to wake it up. PWA tells me that it's reconnecting, and goes back to my first tab.
Then of course I have to navigate back to the energy tab to continue monitoring...
Why can't it load again on the same tab?
I'm assuming that it's as a result of #1552 (but of course I could be wrong. If so, apologies @bartbutenaers )
The text was updated successfully, but these errors were encountered: