mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
Fix of errors: automatic and some manual
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
Reference in New Issue
Block a user