Skip to content

Commit

Permalink
add delay for generated media
Browse files Browse the repository at this point in the history
  • Loading branch information
stCarolas committed Dec 18, 2024
1 parent 380167b commit 25ca6e9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/logic/alert/AlertController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,22 @@ export class AlertController {
);
const showTime = this.findSetting(alert.properties, "imageShowTime", null);
const appearance = this.findSetting(alert.properties, "appearance", "none");
const delay = (ms: number) => {
var start = new Date().getTime();
var end = start;
while(end < start + ms) {
end = new Date().getTime();
}
}

this.alertImageRenderers.forEach((renderer) => {
console.log(alert.properties);
if (data.media?.url) {
log.debug({ image: data.media.url }, "rendering generated image");
renderer.setImage(
`${process.env.REACT_APP_FILE_API_ENDPOINT}${data.media.url}`,
);
delay(5000);
} else if (alert.image) {
log.debug({ image: alert.image }, "rendering image");
renderer.setImage(
Expand Down

0 comments on commit 25ca6e9

Please sign in to comment.