File tree 2 files changed +11
-5
lines changed
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>
915
915
916
916
< div class ="dropdown ">
917
917
< button class ="btn btn-secondary dropdown-toggle " type ="button " id ="dropdownMenuButton1 " data-bs-toggle ="dropdown " aria-expanded ="false ">
918
- Dropdown button
918
+ :
919
919
</ button >
920
920
< 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 >
922
922
< li > < a class ="dropdown-item " href ="# "> Another action</ a > </ li >
923
923
< li > < a class ="dropdown-item " href ="# "> Something else here</ a > </ li >
924
924
</ ul >
Original file line number Diff line number Diff line change @@ -75,14 +75,20 @@ function loginUser(user) {
75
75
76
76
function open_chat ( ) {
77
77
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.');
79
79
$ ( '#login' ) . addClass ( 'd-none' ) ;
80
80
$ ( '#chat' ) . removeClass ( 'd-none' ) ;
81
81
}
82
82
else {
83
- alert ( 'Please login first.' ) ;
83
+ // alert('Please login first.');
84
84
$ ( '#login' ) . removeClass ( 'd-none' ) ;
85
85
$ ( '#chat' ) . addClass ( 'd-none' ) ;
86
86
} ;
87
87
}
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