File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -25,21 +25,11 @@ function homePageSetup() {
2525 const input_item = document . getElementById ( 'knock_name_input' ) ;
2626 for ( const button of buttons ) {
2727 button . addEventListener ( "click" , ( ) => {
28- document . cookie = " name=" + input_item . value ;
28+ localStorage . name = input_item . value ;
2929 knockSocket ( `${ button . id } ` ) ;
3030 } ) ;
3131 }
32- // Check the cookie to see if a name is included
33- let ca = document . cookie . split ( ';' ) ;
34- for ( let i = 0 ; i < ca . length ; i ++ ) {
35- let c = ca [ i ] ;
36- while ( c . charAt ( 0 ) == ' ' ) {
37- c = c . substring ( 1 ) ;
38- }
39- if ( c . indexOf ( 'name=' ) == 0 ) {
40- input_item . value = c . substring ( 5 , c . length ) ;
41- }
42- }
32+ input_item . value = localStorage . name ?? "" ;
4333}
4434
4535function knockSocket ( location ) {
You can’t perform that action at this time.
0 commit comments