Fix: load après restart
Après restart, on a un Obnject dans les settings, pas une liste => plante la fenêtre
This commit is contained in:
parent
f3cd783f12
commit
5a87791b41
@ -58,13 +58,17 @@ export class RdDCalendrier extends Application {
|
|||||||
}
|
}
|
||||||
// nombre astral
|
// nombre astral
|
||||||
if ( game.user.isGM) {
|
if ( game.user.isGM) {
|
||||||
this.listeNombreAstral = duplicate(game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral"));
|
this.listeNombreAstral = this._loadListNombreAstral();
|
||||||
this.rebuildListeNombreAstral(); // Ensure always up-to-date
|
this.rebuildListeNombreAstral(); // Ensure always up-to-date
|
||||||
}
|
}
|
||||||
console.log(this.calendrier, this.calendrierPos, this.listeNombreAstral);
|
console.log(this.calendrier, this.calendrierPos, this.listeNombreAstral);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_loadListNombreAstral() {
|
||||||
|
return Object.values(game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral"));
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
const options = super.defaultOptions;
|
const options = super.defaultOptions;
|
||||||
@ -114,7 +118,7 @@ export class RdDCalendrier extends Application {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getNombreAstral( index ) {
|
getNombreAstral( index ) {
|
||||||
const liste = this.listeNombreAstral || game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral")
|
const liste = this.listeNombreAstral || this._loadListNombreAstral();
|
||||||
let astralData = liste.find( (nombreAstral, i) => nombreAstral.index == index );
|
let astralData = liste.find( (nombreAstral, i) => nombreAstral.index == index );
|
||||||
return astralData.nombreAstral || "N/A";
|
return astralData.nombreAstral || "N/A";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user