From 6f88cef0922f0319cf6fe77eb25a137e08d20395 Mon Sep 17 00:00:00 2001 From: Himanshu Tanwar Date: Tue, 15 Oct 2019 19:49:45 +0530 Subject: [PATCH] check if the user is loggedin, and hide signout button if not. fixes #48 --- index.html | 4 ++-- js/login.js | 4 ++++ src/gallery/index.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 js/login.js diff --git a/index.html b/index.html index 1fcb61e..a1895e8 100644 --- a/index.html +++ b/index.html @@ -59,7 +59,7 @@ -
+
@@ -189,5 +189,5 @@

Chart

- + \ No newline at end of file diff --git a/js/login.js b/js/login.js new file mode 100644 index 0000000..ba5020c --- /dev/null +++ b/js/login.js @@ -0,0 +1,4 @@ +window.loggedIn = localStorage.getItem('user') +if (!window.loggedIn) { + document.getElementById('loginContainer').style.display = 'none' +} \ No newline at end of file diff --git a/src/gallery/index.html b/src/gallery/index.html index f96624e..47af613 100644 --- a/src/gallery/index.html +++ b/src/gallery/index.html @@ -218,5 +218,5 @@ - + \ No newline at end of file