- this.getMessage(this.item.url).then(function (message) {
- // keep the original config value if no value is provided by the endpoint
- for (const prop of ["title", "style", "content"]) {
- if (prop in message && message[prop] !== null) {
- that.item[prop] = message[prop];
- }
+ const fetchedMessage = await this.getMessage(this.item.url);
+ // keep the original config value if no value is provided by the endpoint
+ for (const prop of ["title", "style", "content"]) {
+ if (prop in fetchedMessage && fetchedMessage[prop] !== null) {
+ this.message[prop] = fetchedMessage[prop];