Files
pulse/public/js/hotReload.js
T
rcourtman f53550fc6c fix: simplify frontend update channel switching for better UX
- Remove confusing "preview mode" - channels switch and save immediately
- Eliminate complex localStorage channel persistence logic
- Reduce update reload time from 10+ seconds to 3 seconds
- Remove redundant "Switch to X & Update" buttons
- Make channel switching instant with immediate feedback

Users can now simply change the dropdown to switch channels instantly,
then click Apply Update for a fast 3-second reload experience.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-14 11:01:03 +01:00

20 lines
393 B
JavaScript

(function setupHotReload() {
const socket = io();
socket.on('hotReload', function() {
window.location.reload();
});
let wasConnected = false;
socket.on('connect', function() {
if (wasConnected) {
setTimeout(() => window.location.reload(), 500);
}
wasConnected = true;
});
socket.on('disconnect', function(reason) {
wasConnected = false;
});
})();