From 7156a2fa175eb9730a2bef1bd8b9f36fb05ba072 Mon Sep 17 00:00:00 2001 From: Andor Ambarus Date: Fri, 24 Nov 2023 14:36:32 +0100 Subject: [PATCH] Added FETCH_PHOTO Notification --- WallberryTheme.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/WallberryTheme.js b/WallberryTheme.js index d89a43b..c24ba77 100644 --- a/WallberryTheme.js +++ b/WallberryTheme.js @@ -71,6 +71,27 @@ Module.register("WallberryTheme", { case "ELECTRON_CACHE_CLEARED": this.fetchPhoto(); break; + case "FETCH_PHOTO": + this.fetchPhoto(); + break; + } + }, + + notificationReceived(notification, payload, sender) { + switch(notification){ + case "SHOW_ALERT": + if (payload.type === "notification") { + this.showNotification(payload); + } else { + this.showAlert(payload, sender); + } + break; + case "SHOW_ALERT": + this.hideAlert(sender); + break; + case "FETCH_PHOTO": + this.fetchPhoto(); + break; } }, @@ -170,7 +191,7 @@ Module.register("WallberryTheme", { resume: function() { Log.info("Waking WallberryTheme..."); clearTimeout(this.fetchTimer); - this.fetchPhoto(); + //this.fetchPhoto(); // Uncommented this to disable refresh upon resume. not necessarily needed to fetch every time }, nunjucksEnvironment: function() {