// Look for a new message if an endpoint is provided.
this.message = Object.assign({}, this.item);
await this.getMessage();
// Look for a new message if an endpoint is provided.
this.message = Object.assign({}, this.item);
await this.getMessage();
// 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) {
// 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) {
- console.log(this.item.refreshInterval);
- if (this.item.refreshInterval) setTimeout(this.getMessage, this.item.refreshInterval);
+ if (this.item.refreshInterval)
+ setTimeout(this.getMessage, this.item.refreshInterval);
mapRemoteMessage: function (message) {
let mapped = {};
// map property from message into mapped according to mapping config (only if field has a value):
mapRemoteMessage: function (message) {
let mapped = {};
// map property from message into mapped according to mapping config (only if field has a value):
- for (const prop in this.item.mapping) if (message[this.item.mapping[prop]]) mapped[prop] = message[this.item.mapping[prop]];
+ for (const prop in this.item.mapping)
+ if (message[this.item.mapping[prop]])
+ mapped[prop] = message[this.item.mapping[prop]];