Spaces:
Running
Running
Update index.html
Browse files- index.html +7 -4
index.html
CHANGED
|
@@ -464,7 +464,8 @@
|
|
| 464 |
|
| 465 |
// mainLoginButton (in UI header) -> open login modal for upgrade from anonymous or to login
|
| 466 |
mainLoginButton.addEventListener('click', async () => {
|
| 467 |
-
//
|
|
|
|
| 468 |
loginOverlay.style.display = 'flex';
|
| 469 |
setTimeout(() => { loginOverlay.style.opacity = '1'; }, 10);
|
| 470 |
});
|
|
@@ -514,7 +515,7 @@
|
|
| 514 |
|
| 515 |
if (authStatus) {
|
| 516 |
authStatus.classList.remove('hidden');
|
| 517 |
-
authStatus.textContent = isAnonymous ? 'Estado: Anónimo' : `Estado: Autenticado (${user.email || '
|
| 518 |
}
|
| 519 |
|
| 520 |
if (user.isAnonymous) {
|
|
@@ -556,6 +557,8 @@
|
|
| 556 |
|
| 557 |
mainLoginButton.style.display = 'inline-block';
|
| 558 |
mainLogoutButton.style.display = 'none';
|
|
|
|
|
|
|
| 559 |
if (authStatus) {
|
| 560 |
authStatus.textContent = 'Estado: No autenticado';
|
| 561 |
authStatus.classList.remove('hidden');
|
|
@@ -967,8 +970,8 @@
|
|
| 967 |
visualizeRoot(rootTopic, mapOrigin);
|
| 968 |
visualizeHashtags(parsedData.lista_palabras, mapOrigin, 1, null);
|
| 969 |
|
| 970 |
-
// Guardar
|
| 971 |
-
if (db && userId
|
| 972 |
await saveMapToFirestore(rootTopic, "3", mapOrigin, parsedData);
|
| 973 |
}
|
| 974 |
} else {
|
|
|
|
| 464 |
|
| 465 |
// mainLoginButton (in UI header) -> open login modal for upgrade from anonymous or to login
|
| 466 |
mainLoginButton.addEventListener('click', async () => {
|
| 467 |
+
// Abrir modal de login y ocultar opción anónima mientras se solicita inicio de sesión
|
| 468 |
+
if (anonymousLoginButton) anonymousLoginButton.style.display = 'none';
|
| 469 |
loginOverlay.style.display = 'flex';
|
| 470 |
setTimeout(() => { loginOverlay.style.opacity = '1'; }, 10);
|
| 471 |
});
|
|
|
|
| 515 |
|
| 516 |
if (authStatus) {
|
| 517 |
authStatus.classList.remove('hidden');
|
| 518 |
+
authStatus.textContent = isAnonymous ? 'Estado: Anónimo' : `Estado: Autenticado (${user.email || 'email no disponible'})`;
|
| 519 |
}
|
| 520 |
|
| 521 |
if (user.isAnonymous) {
|
|
|
|
| 557 |
|
| 558 |
mainLoginButton.style.display = 'inline-block';
|
| 559 |
mainLogoutButton.style.display = 'none';
|
| 560 |
+
// Restaurar botón de anónimo cuando no hay usuario autenticado
|
| 561 |
+
if (anonymousLoginButton) anonymousLoginButton.style.display = 'block';
|
| 562 |
if (authStatus) {
|
| 563 |
authStatus.textContent = 'Estado: No autenticado';
|
| 564 |
authStatus.classList.remove('hidden');
|
|
|
|
| 970 |
visualizeRoot(rootTopic, mapOrigin);
|
| 971 |
visualizeHashtags(parsedData.lista_palabras, mapOrigin, 1, null);
|
| 972 |
|
| 973 |
+
// Guardar si hay sesión (incluye usuarios anónimos con uid)
|
| 974 |
+
if (db && userId) {
|
| 975 |
await saveMapToFirestore(rootTopic, "3", mapOrigin, parsedData);
|
| 976 |
}
|
| 977 |
} else {
|