mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-03-08 09:07:57 +03:00
Move social to LauncherUI
This commit is contained in:
parent
e75952ca68
commit
0cde3979bf
2 changed files with 15 additions and 9 deletions
|
@ -156,6 +156,19 @@ export class LauncherUI
|
|||
Genshinlib.getBackgroundUri().then(uri => $('body').css('background-image', `url(${uri})`));
|
||||
}
|
||||
|
||||
public static updateSocial (): void
|
||||
{
|
||||
fetch(`https://genshin.mihoyo.com/launcher/10/${Genshinlib.lang.launcher}?api_url=https%3A%2F%2Fapi-os-takumi.mihoyo.com%2Fhk4e_global&prev=false`)
|
||||
.then(res => res.text())
|
||||
.then(body => {
|
||||
$('#__layout').remove();
|
||||
$(body).find('#__layout').appendTo('#launchcontent');
|
||||
|
||||
$('#launchcontent .home__main .home-swiper-wrap').remove();
|
||||
$('#launchcontent .home__main .home-news').remove();
|
||||
});
|
||||
}
|
||||
|
||||
public static updateLang (lang: string|null = null): void
|
||||
{
|
||||
if (lang !== null)
|
||||
|
|
|
@ -25,18 +25,11 @@ $(() => {
|
|||
|
||||
LauncherUI.setState('game-launch-available');
|
||||
LauncherUI.updateBackground();
|
||||
|
||||
fetch(`https://genshin.mihoyo.com/launcher/10/${Genshinlib.lang.launcher}?api_url=https%3A%2F%2Fapi-os-takumi.mihoyo.com%2Fhk4e_global&prev=false`)
|
||||
.then(res => res.text())
|
||||
.then(body => {
|
||||
$(body).find('#__layout').appendTo('#launchcontent');
|
||||
|
||||
$('#launchcontent .home__main .home-swiper-wrap').remove();
|
||||
$('#launchcontent .home__main .home-news').remove();
|
||||
});
|
||||
LauncherUI.updateSocial();
|
||||
|
||||
ipcRenderer.on('change-lang', (event: void, data: any) => {
|
||||
LauncherUI.updateBackground();
|
||||
LauncherUI.updateSocial();
|
||||
// Needs data.lang in the arguments since the button doesn't get updated otherwise.
|
||||
LauncherUI.updateLang(data.lang);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue