-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
19 lines (17 loc) · 819 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//logging out
const logoutButton = document.getElementById('logout-button');
logoutButton.addEventListener('click', function () {
localStorage.removeItem('loggedin_username');
localStorage.removeItem('loggedin_email');
localStorage.removeItem('loggedin_password');
window.location = 'index.html';
});
const loggedin_username = localStorage.getItem('loggedin_username');
const loggedin_email = localStorage.getItem('loggedin_email');
const loggedin_password = localStorage.getItem('loggedin_password');
if (loggedin_username && loggedin_email && loggedin_password != null) {
document.getElementById('logout-button').className = '';
document.getElementById('login').className = 'hidden';
document.getElementById('sign-up').className = 'hidden';
document.getElementById('transactions').className = '';
}