Don't freeze the UI with old (invalid) states of the drive history

This commit is contained in:
yflory
2019-08-12 16:14:44 +02:00
parent 21658e9de1
commit bbd59c6a2b
3 changed files with 22 additions and 0 deletions

View File

@@ -72,8 +72,22 @@ define([
a[TRASH] = {};
a[FILES_DATA] = {};
a[TEMPLATE] = [];
a[SHARED_FOLDERS] = {};
return a;
};
var type = function (dat) {
return dat === null? 'null': Array.isArray(dat)?'array': typeof(dat);
};
exp.isValidDrive = function (obj) {
var base = exp.getStructure();
return typeof (obj) === "object" &&
Object.keys(base).every(function (key) {
console.log(key, obj[key], type(obj[key]));
return obj[key] && type(base[key]) === type(obj[key]);
});
};
var getHrefArray = function () {
return [TEMPLATE];
};