Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Ikigai.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -241,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
Expand Down