Don't freeze the UI with old (invalid) states of the drive history
This commit is contained in:
parent
21658e9de1
commit
bbd59c6a2b
@ -1036,6 +1036,9 @@ define([
|
|||||||
var isInSharedFolder = _isInSharedFolder;
|
var isInSharedFolder = _isInSharedFolder;
|
||||||
|
|
||||||
/* Generic: doesn't need access to a proxy */
|
/* Generic: doesn't need access to a proxy */
|
||||||
|
var isValidDrive = function (Env, obj) {
|
||||||
|
return Env.user.userObject.isValidDrive(obj);
|
||||||
|
};
|
||||||
var isFile = function (Env, el, allowStr) {
|
var isFile = function (Env, el, allowStr) {
|
||||||
return Env.user.userObject.isFile(el, allowStr);
|
return Env.user.userObject.isFile(el, allowStr);
|
||||||
};
|
};
|
||||||
@ -1131,6 +1134,7 @@ define([
|
|||||||
getUserObjectPath: callWithEnv(getUserObjectPath),
|
getUserObjectPath: callWithEnv(getUserObjectPath),
|
||||||
isDuplicateOwned: callWithEnv(isDuplicateOwned),
|
isDuplicateOwned: callWithEnv(isDuplicateOwned),
|
||||||
// Generic
|
// Generic
|
||||||
|
isValidDrive: callWithEnv(isValidDrive),
|
||||||
isFile: callWithEnv(isFile),
|
isFile: callWithEnv(isFile),
|
||||||
isFolder: callWithEnv(isFolder),
|
isFolder: callWithEnv(isFolder),
|
||||||
isSharedFolder: callWithEnv(isSharedFolder),
|
isSharedFolder: callWithEnv(isSharedFolder),
|
||||||
|
|||||||
@ -72,8 +72,22 @@ define([
|
|||||||
a[TRASH] = {};
|
a[TRASH] = {};
|
||||||
a[FILES_DATA] = {};
|
a[FILES_DATA] = {};
|
||||||
a[TEMPLATE] = [];
|
a[TEMPLATE] = [];
|
||||||
|
a[SHARED_FOLDERS] = {};
|
||||||
return a;
|
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 () {
|
var getHrefArray = function () {
|
||||||
return [TEMPLATE];
|
return [TEMPLATE];
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3900,6 +3900,10 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
history.sfId = false;
|
history.sfId = false;
|
||||||
|
|
||||||
|
var ok = manager.isValidDrive(obj.drive);
|
||||||
|
if (!ok) { return; }
|
||||||
|
|
||||||
copyObjectValue(files, obj.drive);
|
copyObjectValue(files, obj.drive);
|
||||||
appStatus.isReady = true;
|
appStatus.isReady = true;
|
||||||
refresh();
|
refresh();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user