reduce caching errors on test env (#612)

Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
This commit is contained in:
Neil 2023-05-15 20:06:43 +08:00 committed by GitHub
parent 33d7bc3758
commit 7d4469418b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -192,6 +192,7 @@ export default function initializeHandlers({ notifyMainWindow }: HandlerOptions)
ipcMain.handle("cache-image", async (_event, url) => {
try {
if (process.env.NODE_ENV === "test") return url;
log.info("caching:", url);
const cachedImagePath = await cacheImage(url);
return cachedImagePath;