Skip to content

Commit

Permalink
Fix merge conflict commit
Browse files Browse the repository at this point in the history
Accidentally overwrote some new changes
  • Loading branch information
tttzach authored Jun 17, 2020
1 parent 0ffb42b commit 0f15f74
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions portfolio/src/main/webapp/libraries.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,16 @@ function drawCoronavirusChart() {

async function getLoginStatus() {
const response = await fetch('/authentication');
const responseHtml = await response.text();
document.getElementById('login-status').innerHTML = responseHtml;
if (responseHtml.includes('Logout')) {
document.getElementById('comments-form').style.display = 'block';
}
const json = await response.json();
const userEmail = getEmail(json);
const redirectUrl = getUrl(json);
if (userEmail == 'N/A') {
const html = loginHtml(redirectUrl);
document.getElementById('login-status').innerHTML = html;
} else {
const html = logoutHtml(userEmail, redirectUrl);
document.getElementById('login-status').innerHTML = html;
document.getElementById('comments-form').style.display = "block";
}

function getEmail(json) {
Expand Down

0 comments on commit 0f15f74

Please sign in to comment.