Fix of errors: automatic and some manual

This commit is contained in:
2024-11-04 19:56:03 +01:00
parent 90798b12e5
commit f05c25853c
41 changed files with 101 additions and 148 deletions

View File

@@ -6,7 +6,7 @@ import {
} from "../../../../../../ChillDocStoreBundle/Resources/public/types";
async function reload_if_needed(stored_object: StoredObject, i: number): Promise<void> {
let current_status = await is_object_ready(stored_object);
const current_status = await is_object_ready(stored_object);
if (stored_object.status !== current_status.status) {
window.location.reload();
@@ -19,7 +19,7 @@ function wait_before_reload(stored_object: StoredObject, i: number): void {
/**
* value of the timeout. Set to 5 sec during the first 10 minutes, then every 1 minute
*/
let timeout = i < 1200 ? 5000 : 60000;
const timeout = i < 1200 ? 5000 : 60000;
setTimeout(
reload_if_needed,
@@ -30,11 +30,11 @@ function wait_before_reload(stored_object: StoredObject, i: number): void {
}
window.addEventListener('DOMContentLoaded', async function (e) {
if (undefined === (<any>window).stored_object) {
if (undefined === (window as any).stored_object) {
console.error('window.stored_object is undefined');
throw Error('window.stored_object is undefined');
}
let stored_object = JSON.parse((<any>window).stored_object) as StoredObject;
const stored_object = JSON.parse((window as any).stored_object) as StoredObject;
reload_if_needed(stored_object, 0);
});