fix progress bar and page statuses on reload
This commit is contained in:
parent
7986b04615
commit
0cef282b45
|
@ -319,6 +319,7 @@ const index = (() => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const btnNavigateRefreshClick = () => {
|
const btnNavigateRefreshClick = () => {
|
||||||
|
navigation.resetStatuses();
|
||||||
LoadTwcData();
|
LoadTwcData();
|
||||||
UpdateFullScreenNavigate();
|
UpdateFullScreenNavigate();
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ const navigation = (() => {
|
||||||
// draw the progress canvas and hide others
|
// draw the progress canvas and hide others
|
||||||
hideAllCanvases();
|
hideAllCanvases();
|
||||||
document.getElementById('loading').style.display = 'none';
|
document.getElementById('loading').style.display = 'none';
|
||||||
progress = new Progress(-1, 'progress');
|
if (!progress) progress = new Progress(-1, 'progress');
|
||||||
await progress.drawCanvas();
|
await progress.drawCanvas();
|
||||||
progress.showCanvas();
|
progress.showCanvas();
|
||||||
|
|
||||||
|
@ -289,6 +289,11 @@ const navigation = (() => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// reset all statuses to loading on all displays, used to keep the progress bar accurate during refresh
|
||||||
|
const resetStatuses = () => {
|
||||||
|
displays.forEach((display) => { display.status = STATUS.loading; });
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init,
|
init,
|
||||||
message,
|
message,
|
||||||
|
@ -301,5 +306,6 @@ const navigation = (() => {
|
||||||
getCurrentWeather,
|
getCurrentWeather,
|
||||||
getSun,
|
getSun,
|
||||||
resize,
|
resize,
|
||||||
|
resetStatuses,
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue