prevent Reload UI button/link from reloading the page when it's not yet ready
This commit is contained in:
parent
eb95809501
commit
ad6ec02261
@ -395,7 +395,16 @@ function update_token_counter(button_id) {
|
||||
|
||||
function restart_reload(){
|
||||
document.body.innerHTML='<h1 style="font-family:monospace;margin-top:20%;color:lightgray;text-align:center;">Reloading...</h1>';
|
||||
setTimeout(function(){location.reload()},2000)
|
||||
|
||||
var requestPing = function(){
|
||||
requestGet("./internal/ping", {}, function(data){
|
||||
location.reload();
|
||||
}, function(){
|
||||
setTimeout(requestPing, 500);
|
||||
})
|
||||
}
|
||||
|
||||
setTimeout(requestPing, 2000);
|
||||
|
||||
return []
|
||||
}
|
||||
|
@ -1958,3 +1958,5 @@ def setup_ui_api(app):
|
||||
return [QuicksettingsHint(name=k, label=v.label) for k, v in opts.data_labels.items()]
|
||||
|
||||
app.add_api_route("/internal/quicksettings-hint", quicksettings_hint, methods=["GET"], response_model=List[QuicksettingsHint])
|
||||
|
||||
app.add_api_route("/internal/ping", lambda: {}, methods=["GET"])
|
||||
|
Loading…
Reference in New Issue
Block a user