Convert module-start to async (#3049)

Similar to the node_helper async start PR...

---------

Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
Veeck
2023-02-22 18:58:29 +01:00
committed by GitHub
parent fe0b915a5d
commit 498b440174
5 changed files with 34 additions and 19 deletions

View File

@@ -33,16 +33,15 @@ Module.register("compliments", {
},
// Define start sequence.
start: function () {
start: async function () {
Log.info("Starting module: " + this.name);
this.lastComplimentIndex = -1;
if (this.config.remoteFile !== null) {
this.loadComplimentFile().then((response) => {
this.config.compliments = JSON.parse(response);
this.updateDom();
});
const response = await this.loadComplimentFile();
this.config.compliments = JSON.parse(response);
this.updateDom();
}
// Schedule update timer.