File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ function request(target, data) {
3939///////////////////////////////////
4040function requestUser ( ) {
4141 return request ( 'ip' , null ) . then ( prom => {
42- user = String ( prom )
42+ user = String ( prom ) || "default"
4343 console . log ( "user " , user )
4444 } )
4545}
@@ -86,7 +86,7 @@ function loadData() {
8686 . then ( ( d ) => {
8787 let data = tryParce ( d ) //here we parce json
8888 console . log ( "[DATA] from loadData(): " , data )
89- res ( data )
89+ res ( data || [ ] )
9090 } )
9191 . catch ( rej )
9292 } )
@@ -96,7 +96,7 @@ function postData(postData) {
9696 ? loadData ( null )
9797 : Promise . resolve ( null ) )
9898 . then ( ( data ) => {
99- let pDat = postData == null ? postData . concat ( data ) : postData
99+ let pDat = postData === null ? ( data || [ ] ) : postData
100100 requestPostData ( pDat )
101101 } )
102102}
@@ -123,7 +123,7 @@ function App() {
123123 React . useEffect ( loadDataToServer , [ cardsArr ] )
124124
125125 function loadDataToServer ( ) {
126- // console.log("***\n[HOOK] - loadDataToServer (onCardsArr)\n***")
126+ console . log ( "***\n[HOOK] - loadDataToServer (onCardsArr)\n***" )
127127 postData ( cardsArr )
128128 }
129129
You can’t perform that action at this time.
0 commit comments