mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2026-01-15 12:15:02 +00:00
Fix date compare and when to reset wallpaper
Some checks failed
Tests / tests (push) Has been cancelled
Some checks failed
Tests / tests (push) Has been cancelled
This commit is contained in:
@@ -271,14 +271,14 @@ const useWallpaper = (
|
|||||||
cleanUpBufferUrl(currentWallpaperUrl);
|
cleanUpBufferUrl(currentWallpaperUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
resetWallpaper();
|
|
||||||
|
|
||||||
let wallpaperUrl = "";
|
let wallpaperUrl = "";
|
||||||
let fallbackBackground = "";
|
let fallbackBackground = "";
|
||||||
let newWallpaperFit = wallpaperFit;
|
let newWallpaperFit = wallpaperFit;
|
||||||
const isSlideshow = wallpaperName === "SLIDESHOW";
|
const isSlideshow = wallpaperName === "SLIDESHOW";
|
||||||
|
|
||||||
if (isSlideshow) {
|
if (isSlideshow) {
|
||||||
|
resetWallpaper();
|
||||||
|
|
||||||
const slideshowFilePath = `${PICTURES_FOLDER}/${SLIDESHOW_FILE}`;
|
const slideshowFilePath = `${PICTURES_FOLDER}/${SLIDESHOW_FILE}`;
|
||||||
|
|
||||||
if (!(await exists(slideshowFilePath))) {
|
if (!(await exists(slideshowFilePath))) {
|
||||||
@@ -335,13 +335,18 @@ const useWallpaper = (
|
|||||||
// eslint-disable-next-line unicorn/no-unreadable-array-destructuring
|
// eslint-disable-next-line unicorn/no-unreadable-array-destructuring
|
||||||
const [, , currentDate] = wallpaperImage.split(" ");
|
const [, , currentDate] = wallpaperImage.split(" ");
|
||||||
const [month, , day, , year] = new Intl.DateTimeFormat(DEFAULT_LOCALE, {
|
const [month, , day, , year] = new Intl.DateTimeFormat(DEFAULT_LOCALE, {
|
||||||
|
day: "2-digit",
|
||||||
|
month: "2-digit",
|
||||||
timeZone: "US/Eastern",
|
timeZone: "US/Eastern",
|
||||||
|
year: "numeric",
|
||||||
})
|
})
|
||||||
.formatToParts(Date.now())
|
.formatToParts(Date.now())
|
||||||
.map(({ value }) => value);
|
.map(({ value }) => value);
|
||||||
|
|
||||||
if (currentDate === `${year}-${month}-${day}`) return;
|
if (currentDate === `${year}-${month}-${day}`) return;
|
||||||
|
|
||||||
|
resetWallpaper();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
date = "",
|
date = "",
|
||||||
hdurl = "",
|
hdurl = "",
|
||||||
@@ -373,6 +378,8 @@ const useWallpaper = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (await exists(wallpaperImage)) {
|
} else if (await exists(wallpaperImage)) {
|
||||||
|
resetWallpaper();
|
||||||
|
|
||||||
let fileData = await readFile(wallpaperImage);
|
let fileData = await readFile(wallpaperImage);
|
||||||
const imgExt = getExtension(wallpaperImage);
|
const imgExt = getExtension(wallpaperImage);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user