mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-19 16:33:04 +03:00
Fix image not showing on first launch when build
This commit is contained in:
parent
2bef5e2245
commit
310a96183f
1 changed files with 4 additions and 4 deletions
|
@ -102,7 +102,7 @@ export class Genshinlib
|
||||||
{
|
{
|
||||||
await fetch(`https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/content?filter_adv=true&launcher_id=10&language=${this.lang.launcher}`)
|
await fetch(`https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/content?filter_adv=true&launcher_id=10&language=${this.lang.launcher}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(resdone => {
|
.then(async resdone => {
|
||||||
let oldbg = this.getConfig().background.name;
|
let oldbg = this.getConfig().background.name;
|
||||||
|
|
||||||
this.setConfig({
|
this.setConfig({
|
||||||
|
@ -119,10 +119,10 @@ export class Genshinlib
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.downloadFile(resdone.data.adv.background, path.join(this.launcherDir, this.getConfig().background.name), (current: number, total: number, difference: number) => null).then(() => {
|
await this.downloadFile(resdone.data.adv.background, path.join(this.launcherDir, this.getConfig().background.name), (current: number, total: number, difference: number) => null).then(() => {
|
||||||
oldbg ? fs.unlinkSync(path.join(this.launcherDir, oldbg)) : '';
|
!oldbg ? console.log('No Old Background Found.') : fs.unlinkSync(path.join(this.launcherDir, oldbg));
|
||||||
bg = path.join(this.launcherDir, this.getConfig().background.name);
|
bg = path.join(this.launcherDir, this.getConfig().background.name);
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue