From 3822fb1ed38bc1aad95ea9364dd5461c1990dc4d Mon Sep 17 00:00:00 2001 From: Allen Ding Date: Wed, 24 Jul 2024 17:25:24 -0700 Subject: [PATCH] fix preview image not updating when animation path is changed --- src/main/index.ts | 3 ++- src/renderer/components/settings/CustomSplashAnimation.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index 97213fa..f8ba285 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -27,7 +27,7 @@ if (IS_DEV) { process.env.VENCORD_USER_DATA_DIR = DATA_DIR; function init() { - const { disableSmoothScroll, hardwareAcceleration, splashAnimationPath } = Settings.store; + const { disableSmoothScroll, hardwareAcceleration } = Settings.store; const enabledFeatures = app.commandLine.getSwitchValue("enable-features").split(","); const disabledFeatures = app.commandLine.getSwitchValue("disable-features").split(","); @@ -83,6 +83,7 @@ function init() { //register file handler so we can load the custom splash animation from the user's filesystem protocol.handle("splash-animation", () => { + const { splashAnimationPath } = Settings.store; return net.fetch("file:///"+splashAnimationPath); }); diff --git a/src/renderer/components/settings/CustomSplashAnimation.tsx b/src/renderer/components/settings/CustomSplashAnimation.tsx index 1079a97..578bce1 100644 --- a/src/renderer/components/settings/CustomSplashAnimation.tsx +++ b/src/renderer/components/settings/CustomSplashAnimation.tsx @@ -19,7 +19,8 @@ export const CustomSplashAnimation: SettingsComponent = ({ settings }) => { alignItems: "center", gap: "16px" }}> - + {/* adding the Math.random() here ensures that a new image is fetched when the user changes the path */} +

The custom splash animation is enabled. It is loaded from