From 67756f4da5b909563bbe43b6857f56d53755e8be Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Wed, 20 Jul 2022 11:12:42 -0400 Subject: [PATCH 1/2] Cycle "Every Day" at midnight, not every 24 hrs If "Cycle Background" is set to "Every Day," this makes it cycle every midnight rather than every 24 hours. It was a little strange to have the wallpaper changing at like 6PM every day, because that's when I first installed the extension. --- src/Ikigai.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Ikigai.js b/src/Ikigai.js index 5226a17c..df795927 100644 --- a/src/Ikigai.js +++ b/src/Ikigai.js @@ -149,6 +149,10 @@ export class Ikigai extends Component { let time_now = Math.round(new Date().getTime() / 1000); let background_update_freq = parseInt(this.state.background_cycle); + if (background_update_freq == 86400) { + background_last_updated = new Date(background_last_updated * 1000).setHours(0,0,0,0)/1000; + } + if (background_last_updated + background_update_freq <= time_now) { this.refetchAndSetImageHidden(); let time_now = Math.round(new Date().getTime() / 1000); From e6ab96923ed78a6181b3cfbe77c2000812b1c4e5 Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Thu, 21 Jul 2022 19:00:31 -0400 Subject: [PATCH 2/2] Add this to logNextBackgroundChange too --- src/Ikigai.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Ikigai.js b/src/Ikigai.js index df795927..d689b5ed 100644 --- a/src/Ikigai.js +++ b/src/Ikigai.js @@ -245,6 +245,10 @@ export class Ikigai extends Component { localStorage.getItem("background_last_updated") ); + if (background_update_freq == 86400) { + background_last_updated = new Date(background_last_updated * 1000).setHours(0,0,0,0)/1000; + } + console.log( `Next Background change at ${this.unixToHumanTime( background_update_freq + background_last_updated