mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Add translation loading to splash
This commit is contained in:
parent
c979328aee
commit
a29cb2a6a5
1 changed files with 45 additions and 44 deletions
|
@ -17,29 +17,27 @@
|
|||
</div>
|
||||
</body>
|
||||
<script>
|
||||
async function loadLang() {
|
||||
const text = document.getElementById("text-splashscreen");
|
||||
if (window.navigator.onLine === false) {
|
||||
text.innerHTML = "You appear to be offline. Please connect to the internet and try again.";
|
||||
text.innerHTML = await armcord.getLang("loading_screen_offline");
|
||||
} else {
|
||||
text.innerHTML = "Starting ArmCord...";
|
||||
text.innerHTML = await armcord.getLang("loading_screen_start");
|
||||
if (window.armcord.version === "DEV") {
|
||||
console.log("Running a development build of ArmCord. Skipping updater.");
|
||||
} else {
|
||||
fetch("https://armcord.xyz/latest.json")
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const response = await fetch("https://armcord.xyz/latest.json");
|
||||
const data = await response.json();
|
||||
if (data.version !== window.armcord.version) {
|
||||
var elem = document.createElement("img");
|
||||
elem.classList.add("logo");
|
||||
elem.src = "https://armcord.smartfridge.space/update.webp";
|
||||
document.body.prepend(elem);
|
||||
document.getElementById("splashscreen-armcord").remove();
|
||||
text.innerHTML =
|
||||
"A new version of ArmCord is available. Please update to the latest version.";
|
||||
text.innerHTML = await armcord.getLang("loading_screen_update");
|
||||
} else {
|
||||
console.log("ArmCord is up to date.");
|
||||
}
|
||||
});
|
||||
}
|
||||
setTimeout(() => {
|
||||
window.armcordinternal.splashEnd();
|
||||
|
@ -64,5 +62,8 @@
|
|||
}
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
loadLang();
|
||||
</script>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue