fix preview image not updating when animation path is changed

This commit is contained in:
Allen Ding 2024-07-24 17:25:24 -07:00
parent 209d4cde81
commit 3822fb1ed3
2 changed files with 4 additions and 2 deletions

View file

@ -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);
});

View file

@ -19,7 +19,8 @@ export const CustomSplashAnimation: SettingsComponent = ({ settings }) => {
alignItems: "center",
gap: "16px"
}}>
<img src="splash-animation:///" width="64px" height="64px"></img>
{/* adding the Math.random() here ensures that a new image is fetched when the user changes the path */}
<img src={"splash-animation:///" + Math.random()} width="64px" height="64px"></img>
<p>The custom splash animation is enabled. It is loaded from
<a
href="about:blank"