damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README | LICENSE

commit 62579db3a3258dab6c55060e6a2a900f5aa5db68
parent ffbd5efe65912d5ad3d47da8542d8379741a32a3
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 11 Nov 2022 18:21:05 -0800

web: add logout button

Diffstat:
Mweb/damus.js | 7+++++++
Mweb/index.html | 6+++---
2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/web/damus.js b/web/damus.js @@ -878,6 +878,13 @@ function render_deleted_comment_body(ev, deleted) { return `<div class="deleted-comment">This comment was deleted</div>` } +function press_logout() { + if (confirm("Are you sure you want to logout?")) { + localStorage.clear(); + location.reload(); + } +} + function render_event(model, ev, opts={}) { if (ev.kind === 6) return render_boost(model, ev, opts) diff --git a/web/index.html b/web/index.html @@ -28,8 +28,8 @@ <i class="fa fa-fw fa-gear"></i><span class="hide">Settings</span> </button></div> <div> - <button class="nav icon"> - <i class="fa-regular fa-fw fa-circle-question"></i><span class="hide">Help</span> + <button onclick="press_logout()" class="nav icon"> + <i class="fa fa-fw fa-arrow-right-from-bracket"></i><span class="hide">Logout</span> </button></div> </div> <div id="content"> @@ -63,7 +63,7 @@ <script src="noble-secp256k1.js?v=1"></script> <script src="bech32.js?v=1"></script> <script src="nostr.js?v=6"></script> - <script src="damus.js?v=63"></script> + <script src="damus.js?v=64"></script> <script> // I have to delay loading to wait for nos2x const relay = setTimeout(damus_web_init, 100)