Feat: Reload timer frontend on new version
This commit is contained in:
parent
1db80aa45c
commit
740a20a011
3 changed files with 7 additions and 1 deletions
|
@ -127,7 +127,8 @@ class SyncedTimer
|
|||
"soundEnabled" => $userdata["soundEnabled"],
|
||||
"repeatEnabled" => $userdata["repeatEnabled"],
|
||||
"currentServerTime" => floor(microtime(true) * 1000),
|
||||
)
|
||||
),
|
||||
"version" => $GLOBALS["VERSION"],
|
||||
)));
|
||||
} else {
|
||||
http_response_code(404);
|
||||
|
|
|
@ -21,6 +21,10 @@ document.addEventListener('alpine:init', () => {
|
|||
return;
|
||||
}
|
||||
|
||||
if(response.version != activeSyncedTimerVersion) {
|
||||
location.reload()
|
||||
}
|
||||
|
||||
this.currentData = response.data
|
||||
Alpine.store("audioPlayback").isDisabledByServer = !this.currentData.soundEnabled
|
||||
this.header = this.currentData.header
|
||||
|
|
|
@ -370,6 +370,7 @@ class LandingpageTheme
|
|||
<footer>
|
||||
<script>
|
||||
const username = "<?= $username ?>";
|
||||
const activeSyncedTimerVersion = "<?= $GLOBALS["VERSION"] ?>"
|
||||
var textElem = document.getElementById("timer");
|
||||
var headerTextElem = document.getElementById("header");
|
||||
var targetWidth = 0.9; // Proportion of full screen width
|
||||
|
|
Loading…
Reference in a new issue