From 575b8a0a30eb966e0efaacec4a543ac1543422cd Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sat, 5 Jun 2021 20:53:43 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20await=20=C3=A0=20l'init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-calendrier.js | 7 ++----- module/rdd-main.js | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 905877f9..a3013ab7 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -175,9 +175,6 @@ export class RdDCalendrier extends Application { liste = this.listeNombreAstral; } let astralData = liste.find((nombreAstral, i) => nombreAstral.index == indexDate); - if (!astralData?.nombreAstral) { - this.rebuildListeNombreAstral(); - } return astralData?.nombreAstral; } @@ -214,7 +211,7 @@ export class RdDCalendrier extends Application { else if (calendarSet) { this.positionnerHeure(Number(calendarSet.value)); } - await this.updateDisplay(); + this.updateDisplay(); } /* -------------------------------------------- */ @@ -226,7 +223,7 @@ export class RdDCalendrier extends Application { } if (this.calendrier.heureRdD > 11) { this.calendrier.heureRdD -= 12; - await this.incrementerJour(); + this.incrementerJour(); } game.settings.set("foundryvtt-reve-de-dragon", "calendrier", duplicate(this.calendrier)); // Notification aux joueurs diff --git a/module/rdd-main.js b/module/rdd-main.js index 1496a5bb..0afcccbd 100644 --- a/module/rdd-main.js +++ b/module/rdd-main.js @@ -210,7 +210,7 @@ function messageDeBienvenue() { /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ -Hooks.once("ready", function () { +Hooks.once("ready", async function () { StatusEffects.onReady(); RdDHerbes.initializeHerbes(); @@ -218,7 +218,7 @@ Hooks.once("ready", function () { /* -------------------------------------------- */ /* Affiche/Init le calendrier */ let calendrier = new RdDCalendrier(); - calendrier.initCalendrier(); + await calendrier.initCalendrier(); let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html"; let templateData = {}; renderTemplate(templatePath, templateData).then(html => {