Skip to content

Commit

Permalink
Roberto
Browse files Browse the repository at this point in the history
  • Loading branch information
EtoDoze committed Feb 16, 2025
1 parent fe3e54d commit 9850289
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ <h2 id="title" >iMenu</h2>
<i class='bx bx-x navClose-btnn'></i>-->
</div>
<div class="perfil_content">
<a href="#" class="logo-content flex">
<img id="perfil" src="images/perfil.png">
<p id="username"></p>
<a href="#" id="conta" class="logo-content flex">
<img id="perfil" src="images/perfil.png" onclick="goperfil()">
<p id="username" onclick="goperfil()"></p>
</a>
<a href="cadastro.html"><button id="button-acount">Cadastrar</button></a>
<a href="login.html"> <button id="button-enter">Entrar</button> </a>
Expand Down
12 changes: 12 additions & 0 deletions js/server_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ async function criaruser() {

if (!token) {
console.log("Token não encontrado.");
const conta = document.getElementById("conta")
conta.remove()
const mapa = document.getElementById("mapaAba");
if (mapa) mapa.remove();
const editor = document.getElementById("editorAba");
if (editor) editor.remove();
return;
}

Expand All @@ -93,6 +99,12 @@ async function criaruser() {
const errorData = await response.json();
console.error("Erro ao buscar o usuário:", errorData.message);
alert(`Erro: ${errorData.message}`);
const conta = document.getElementById("conta")
conta.remove()
const mapa = document.getElementById("mapaAba");
if (mapa) mapa.remove();
const editor = document.getElementById("editorAba");
if (editor) editor.remove();
} else {
const data = await response.json();
console.log("Dados recebidos do servidor:", data);
Expand Down

0 comments on commit 9850289

Please sign in to comment.