You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -74,6 +74,7 @@ export default function DataService() {
74
74
functioncheckData(data){
75
75
//console.log('start check data')
76
76
try{
77
+
if(data===null)console.log("null data");
77
78
returndata===null||data===[]||checkCardsArr(data)
78
79
}catch{
79
80
returnfalse
@@ -92,13 +93,15 @@ export default function DataService() {
92
93
.then((d)=>{
93
94
letdata=tryParce(d)//here we parce json
94
95
//console.log("[DATA] from loadData(): ", data)
96
+
if(!data)console.log("empty data from server");
95
97
if(!checkData(data)){
96
98
console.error("[loadData] Bad data format")
97
99
console.log(data)
98
-
if(user!==null){
100
+
letcheckDel=user!==null
101
+
if(checkDel&&window.confirm("Bad data: "+data+". Delete data on server?")){
99
102
console.log('clear data')
100
103
requestPostData([newCard({id: 0,color: "orange",name: "Error",text: "Данные были очищены из за ошибки"})]).then(()=>loadData().then(res,rej),rej)//очистка данных
101
-
}elserej("Not format data& unlogged")
104
+
}elserej("Not format data"+!user ? " & unlogged" : "")
102
105
}else{
103
106
res(data||[])
104
107
}
@@ -118,7 +121,10 @@ export default function DataService() {
0 commit comments