Skip to content

Commit

Permalink
Fix errores generales + update 1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
1ly4s0 committed Feb 27, 2024
1 parent 88728b3 commit 718bf5b
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 87 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "BattlyLauncher",
"productname": "Battly Launcher",
"version": "1.7.2",
"version": "1.7.3",
"description": "El mejor Launcher Personalizado para Minecraft Premium y No premium",
"main": "src/app.js",
"author": "TECNO BROS <contacto@tecnobros.es>",
Expand Down
41 changes: 21 additions & 20 deletions src/assets/js/panels/friends.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const Toast = Swal.mixin({
});

let amigos;
let lang;

const dataDirectory = process.env.APPDATA || (process.platform == 'darwin' ? `${process.env.HOME}/Library/Application Support` : process.env.HOME)
import { Lang } from "../utils/lang.js";
Expand All @@ -35,7 +36,7 @@ class Friends {
async init(config, news) {
this.config = config;
this.database = await new database().init();
this.lang = await new Lang().GetLang();
lang = await new Lang().GetLang();
this.AddFriend();
this.Solicitudes();
this.GetOnlineUsers();
Expand Down Expand Up @@ -89,7 +90,7 @@ class Friends {

const modalTitle = document.createElement('p');
modalTitle.className = 'modal-card-title';
modalTitle.textContent = this.lang.add_friend_text;
modalTitle.textContent = lang.add_friend_text;

const closeButton = document.createElement('button');
closeButton.className = 'delete';
Expand All @@ -111,7 +112,7 @@ class Friends {
const input = document.createElement('input');
input.className = 'input';
input.setAttribute('type', 'text');
input.setAttribute('placeholder', this.lang.username);
input.setAttribute('placeholder', lang.username);

inputControl.appendChild(input);
inputContainer.appendChild(inputControl);
Expand All @@ -129,7 +130,7 @@ class Friends {

const searchButton = document.createElement('button');
searchButton.className = 'button is-info';
searchButton.textContent = this.lang.search;
searchButton.textContent = lang.search;

modalFooter.appendChild(searchButton);

Expand Down Expand Up @@ -267,13 +268,13 @@ class Friends {
if (user == account.name) {
Toast.fire({
icon: "error",
title: this.lang.you_cannot_add_yourself
title: lang.you_cannot_add_yourself
});
return;
} else if (amigosArray.includes(user)) {
Toast.fire({
icon: "error",
title: this.lang.you_already_have_this_friend,
title: lang.you_already_have_this_friend,
});
return;
} else {
Expand All @@ -285,7 +286,7 @@ class Friends {

Toast.fire({
icon: "success",
title: `${this.lang.request_sent_to} ${user} ${this.lang.correctly}.`,
title: `${lang.request_sent_to} ${user} ${lang.correctly}.`,
});
}
});
Expand Down Expand Up @@ -356,13 +357,13 @@ class Friends {
if (user == account.name) {
Toast.fire({
icon: "error",
title: this.lang.you_cannot_add_yourself
title: lang.you_cannot_add_yourself
});
return;
} else if (amigosArray.includes(user)) {
Toast.fire({
icon: "error",
title: this.lang.you_already_have_this_friend,
title: lang.you_already_have_this_friend,
});
return;
} else {
Expand All @@ -374,7 +375,7 @@ class Friends {

Toast.fire({
icon: "success",
title: `${this.lang.request_sent_to} ${user} ${this.lang.correctly}.`,
title: `${lang.request_sent_to} ${user} ${lang.correctly}.`,
});
}
});
Expand Down Expand Up @@ -418,7 +419,7 @@ class Friends {

const modalTitle = document.createElement('p');
modalTitle.className = 'modal-card-title';
modalTitle.textContent = this.lang.friend_requests;
modalTitle.textContent = lang.friend_requests;

const closeButton = document.createElement('button');
closeButton.className = 'delete';
Expand Down Expand Up @@ -463,7 +464,7 @@ class Friends {

const userParagraph = document.createElement('p');
userParagraph.style.fontSize = '20px';
userParagraph.textContent = this.lang.you_dont_have_any_friend_requests;
userParagraph.textContent = lang.you_dont_have_any_friend_requests;

content.appendChild(userParagraph);
mediaContent.appendChild(content);
Expand Down Expand Up @@ -561,7 +562,7 @@ class Friends {

Toast.fire({
icon: "success",
title: this.lang.request_accepted
title: lang.request_accepted
});

modal.remove();
Expand All @@ -576,7 +577,7 @@ class Friends {

Toast.fire({
icon: "success",
title: this.lang.request_rejected
title: lang.request_rejected
});

modal.remove();
Expand Down Expand Up @@ -662,7 +663,7 @@ class Friends {

Toast.fire({
icon: "success",
title: this.lang.request_accepted
title: lang.request_accepted
});

modal.remove();
Expand All @@ -677,7 +678,7 @@ class Friends {

Toast.fire({
icon: "success",
title: this.lang.request_rejected
title: lang.request_rejected
});

modal.remove();
Expand Down Expand Up @@ -840,7 +841,7 @@ class Friends {

document.querySelector(".preload-content").style.display = "block";
const loadingText = document.getElementById("loading-text");
loadingText.innerHTML = this.lang.loading_friends;
loadingText.innerHTML = lang.loading_friends;

ipcRenderer.send('obtener-amigos', {
username: account.name,
Expand Down Expand Up @@ -872,7 +873,7 @@ class Friends {

const userParagraph = document.createElement('p');
userParagraph.style.fontSize = '20px';
userParagraph.textContent = this.lang.error_loading_friends;
userParagraph.textContent = lang.error_loading_friends;
userParagraph.style.textAlign = 'center';

content.appendChild(userParagraph);
Expand Down Expand Up @@ -1028,7 +1029,7 @@ class Friends {
const br = document.createElement('br');

const status = document.createElement('span');
status.textContent = this.lang.in_the_main_menu;
status.textContent = lang.in_the_main_menu;

// Agregamos la etiqueta <p> y colocamos strong, span, br y status dentro de ella
const paragraph = document.createElement('p');
Expand Down Expand Up @@ -1106,7 +1107,7 @@ class Friends {
const br = document.createElement('br');

const status = document.createElement('span');
status.textContent = this.lang.in_the_main_menu;
status.textContent = lang.in_the_main_menu;

// Agregamos la etiqueta <p> y colocamos strong, span, br y status dentro de ella
const paragraph = document.createElement('p');
Expand Down
7 changes: 0 additions & 7 deletions src/assets/js/panels/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ class Home {
this.GenerarLogsSocket();
this.SetStatus();
this.Solicitudes();
this.lang = await new Lang().GetLang();
this.Ads();
}

Expand Down Expand Up @@ -5937,12 +5936,6 @@ class Home {
number: version_real,
type: "release",
};
} else if (
versionType === "forge" ||
versionType === "fabric" ||
versionType === "quilt"
) {

} else {
versionData = version_real;
}
Expand Down
30 changes: 16 additions & 14 deletions src/assets/js/panels/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import { database, changePanel, addAccount, accountSelect } from '../utils.js';
const { ipcRenderer } = require('electron');
import { Lang } from "../utils/lang.js";

let lang;

class Login {
static id = "login";
async init(config) {
this.config = config
this.database = await new database().init();
this.lang = await new Lang().GetLang();
lang = await new Lang().GetLang();
this.getOffline()
this.getOnline()
this.OpenWeb()
Expand Down Expand Up @@ -52,16 +54,16 @@ class Login {

microsoftBtn.addEventListener("click", () => {
document.querySelector(".preload-content").style.display = "";
document.getElementById("loading-text").innerHTML = this.lang.a_microsoft_panel_opened;
document.getElementById("loading-text").innerHTML = lang.a_microsoft_panel_opened;
microsoftBtn.disabled = true;
mojangBtn.disabled = true;
cancelBtn.disabled = true;
ipcRenderer.invoke('Microsoft-window', this.config.client_id).then(account_connect => {
document.querySelector(".preload-content").style.display = "";
document.getElementById("loading-text").innerHTML = this.lang.logging_in;
document.getElementById("loading-text").innerHTML = lang.logging_in;

if (!account_connect) {
document.getElementById("loading-text").innerHTML = this.lang.error_logging_in;
document.getElementById("loading-text").innerHTML = lang.error_logging_in;
setTimeout(() => {
document.querySelector(".preload-content").style.display = "none";
changePanel("settings");
Expand Down Expand Up @@ -115,7 +117,7 @@ class Login {
mojangBtn.disabled = false;
cancelBtn.disabled = false;

document.getElementById("loading-text").innerHTML = this.lang.error_logging_in;
document.getElementById("loading-text").innerHTML = lang.error_logging_in;
setTimeout(() => {
document.querySelector(".preload-content").style.display = "none";
changePanel("settings");
Expand Down Expand Up @@ -150,11 +152,11 @@ class Login {
mailInput.disabled = true;
passwordInput.disabled = true;
infoLoginPanel.classList.add("is-active");
infoLogin.innerHTML = this.lang.logging_in;
infoLogin.innerHTML = lang.logging_in;


if (mailInput.value == "") {
infoLogin.innerHTML = this.lang.set_your_username;
infoLogin.innerHTML = lang.set_your_username;
setTimeout(() => {
infoLoginPanel.classList.remove("is-active");
}, 3000);
Expand All @@ -166,7 +168,7 @@ class Login {
}

if (mailInput.value.length < 3) {
infoLogin.innerHTML = this.lang.threecharacters_username;
infoLogin.innerHTML = lang.threecharacters_username;
setTimeout(() => {
infoLoginPanel.classList.remove("is-active");
}, 3000);
Expand All @@ -178,7 +180,7 @@ class Login {
};

if (passwordInput.value == "") {
infoLogin.innerHTML = this.lang.set_your_password;
infoLogin.innerHTML = lang.set_your_password;
setTimeout(() => {
infoLoginPanel.classList.remove("is-active");
}, 3000);
Expand All @@ -190,7 +192,7 @@ class Login {
}

if (passwordInput.value.length < 3) {
infoLogin.innerHTML = this.lang.threecharacters_password;
infoLogin.innerHTML = lang.threecharacters_password;
setTimeout(() => {
infoLoginPanel.classList.remove("is-active");
}, 3000);
Expand Down Expand Up @@ -258,7 +260,7 @@ class Login {
try {
let account = accounts.find(account => account.value.uuid == uuid_);
if (account) {
infoLogin.innerHTML = this.lang.account_already_exists;
infoLogin.innerHTML = lang.account_already_exists;
setTimeout(() => {
infoLoginPanel.classList.remove("is-active");
}, 3000);
Expand Down Expand Up @@ -292,7 +294,7 @@ class Login {
passwordInput.disabled = false;
mailInput.value = "";
passwordInput.value = "";
infoLogin.innerHTML = this.lang.username_or_password_incorrect;
infoLogin.innerHTML = lang.username_or_password_incorrect;
setTimeout(() => {
infoLoginPanel.classList.remove("is-active");
}, 3000);
Expand Down Expand Up @@ -364,12 +366,12 @@ class Login {
blockWelcome.innerHTML = `
<div class="news-header">
<div class="header-text">
<div class="title_">${this.lang.welcome_again_to_battly}, ${account.name}</div>
<div class="title_">${lang.welcome_again_to_battly}, ${account.name}</div>
</div>
</div>
<div class="news-content">
<div class="bbWrapper">
<p>${this.lang.we_hope_you_enjoy}</p>
<p>${lang.we_hope_you_enjoy}</p>
</div>
</div>`;
welcome.prepend(blockWelcome);
Expand Down
Loading

0 comments on commit 718bf5b

Please sign in to comment.