Skip to content

Commit

Permalink
add showtime handler for alert message
Browse files Browse the repository at this point in the history
  • Loading branch information
stCarolas committed Feb 6, 2024
1 parent ff598d1 commit b39552e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/logic/alert/AlertController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ export class AlertController {
);
if (showTime) {
setTimeout(() => renderer.setImage(null), showTime * 1000);
} else {
renderer.setImage(null);
}
renderer.setStyle(
this.calculateImageStyle(
Expand Down Expand Up @@ -272,13 +274,16 @@ export class AlertController {
"messageColor",
"#fb8c2b",
);
const showTime = this.findSetting(alert.properties, "imageShowTime", null);
this.messageRenderers.forEach((renderer) => {
renderer.setStyle({
fontSize: messageFontSize ? messageFontSize + "px" : "unset",
fontFamily: messageFont ? messageFont : "unset",
color: messageColor,
});
renderer.setMessage(data.message);
if (showTime) {
setTimeout(() => renderer.setMessage(data.message), showTime * 1000);
}
});
}

Expand Down

0 comments on commit b39552e

Please sign in to comment.