File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -915,10 +915,10 @@ <h2>Live Chat</h2>
915915
916916 < div class ="dropdown ">
917917 < button class ="btn btn-secondary dropdown-toggle " type ="button " id ="dropdownMenuButton1 " data-bs-toggle ="dropdown " aria-expanded ="false ">
918- Dropdown button
918+ :
919919 </ button >
920920 < ul class ="dropdown-menu " aria-labelledby ="dropdownMenuButton1 ">
921- < li > < a class ="dropdown-item " href ="# "> Action </ a > </ li >
921+ < li > < a class ="dropdown-item " href ="# " id =" sign-out " > Sign Out </ a > </ li >
922922 < li > < a class ="dropdown-item " href ="# "> Another action</ a > </ li >
923923 < li > < a class ="dropdown-item " href ="# "> Something else here</ a > </ li >
924924 </ ul >
Original file line number Diff line number Diff line change @@ -75,14 +75,20 @@ function loginUser(user) {
7575
7676function open_chat ( ) {
7777 if ( window . localStorage . getItem ( 'user' ) ) {
78- alert ( 'You are ready to start chatting with me.' ) ;
78+ // alert('You are ready to start chatting with me.');
7979 $ ( '#login' ) . addClass ( 'd-none' ) ;
8080 $ ( '#chat' ) . removeClass ( 'd-none' ) ;
8181 }
8282 else {
83- alert ( 'Please login first.' ) ;
83+ // alert('Please login first.');
8484 $ ( '#login' ) . removeClass ( 'd-none' ) ;
8585 $ ( '#chat' ) . addClass ( 'd-none' ) ;
8686 } ;
8787}
88- open_chat ( ) ;
88+ open_chat ( ) ;
89+
90+ $ ( 'body' ) . on ( 'click' , '#sign-out' , function ( e ) {
91+ e . preventDefault ( ) ;
92+ window . localStorage . removeItem ( 'user' ) ;
93+ window . location . reload ( ) ;
94+ } )
You can’t perform that action at this time.
0 commit comments