fix preview image not updating when animation path is changed
This commit is contained in:
parent
209d4cde81
commit
3822fb1ed3
2 changed files with 4 additions and 2 deletions
|
@ -27,7 +27,7 @@ if (IS_DEV) {
|
||||||
process.env.VENCORD_USER_DATA_DIR = DATA_DIR;
|
process.env.VENCORD_USER_DATA_DIR = DATA_DIR;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
const { disableSmoothScroll, hardwareAcceleration, splashAnimationPath } = Settings.store;
|
const { disableSmoothScroll, hardwareAcceleration } = Settings.store;
|
||||||
|
|
||||||
const enabledFeatures = app.commandLine.getSwitchValue("enable-features").split(",");
|
const enabledFeatures = app.commandLine.getSwitchValue("enable-features").split(",");
|
||||||
const disabledFeatures = app.commandLine.getSwitchValue("disable-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
|
//register file handler so we can load the custom splash animation from the user's filesystem
|
||||||
protocol.handle("splash-animation", () => {
|
protocol.handle("splash-animation", () => {
|
||||||
|
const { splashAnimationPath } = Settings.store;
|
||||||
return net.fetch("file:///"+splashAnimationPath);
|
return net.fetch("file:///"+splashAnimationPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@ export const CustomSplashAnimation: SettingsComponent = ({ settings }) => {
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
gap: "16px"
|
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
|
<p>The custom splash animation is enabled. It is loaded from
|
||||||
<a
|
<a
|
||||||
href="about:blank"
|
href="about:blank"
|
||||||
|
|
Loading…
Reference in a new issue