Commit c0da6d2b authored by martin hou's avatar martin hou

fix: 取消文件数量验证

parent c3543d65
...@@ -666,6 +666,7 @@ Jensen.prototype.listFiles = async function () { ...@@ -666,6 +666,7 @@ Jensen.prototype.listFiles = async function () {
let tag = 'filelist-' + this.serialNumber + '-' + this.sequence(); let tag = 'filelist-' + this.serialNumber + '-' + this.sequence();
if (this[tag] != null) return null; if (this[tag] != null) return null;
/*
let fc = null; let fc = null;
if (typeof this.versionNumber == 'undefined' || this.versionNumber <= 327722) { if (typeof this.versionNumber == 'undefined' || this.versionNumber <= 327722) {
fc = await this.getFileCount(5); fc = await this.getFileCount(5);
...@@ -673,6 +674,7 @@ Jensen.prototype.listFiles = async function () { ...@@ -673,6 +674,7 @@ Jensen.prototype.listFiles = async function () {
} }
if (fc && fc.count == 0) return null; if (fc && fc.count == 0) return null;
*/
let self = this; let self = this;
// let tag = 'data_' + new Date().getTime(); // let tag = 'data_' + new Date().getTime();
...@@ -793,26 +795,13 @@ Jensen.prototype.listFiles = async function () { ...@@ -793,26 +795,13 @@ Jensen.prototype.listFiles = async function () {
jensen[kv] = now; jensen[kv] = now;
if ((fc && files.length >= fc.count) || (fcount > -1 && files.length >= fcount)) { // 要怎么样触发这个回调?
// delete jensen[tag]; jensen[kv] = window.setTimeout(() => {
console.log('remove tag: ' + tag); console.log('remove tag: ' + tag);
jensen[tag] = null; jensen[tag] = null;
window.clearTimeout(jensen[kv]); jensen._trigger(files.filter((f) => { return Boolean(f.time); }), QUERY_FILE_LIST);
console.log('jensen', 'list-files', 'normal return'); console.log('jensen', 'list-files', 'timed return');
return files.filter((f) => { }, 1000);
return Boolean(f.time);
});
}
else
{
// 要怎么样触发这个回调?
jensen[kv] = window.setTimeout(() => {
console.log('remove tag: ' + tag);
jensen[tag] = null;
jensen._trigger(files.filter((f) => { return Boolean(f.time); }), QUERY_FILE_LIST);
console.log('jensen', 'list-files', 'timed return');
}, 1000);
}
}); });
return this.send(new Command(QUERY_FILE_LIST)); return this.send(new Command(QUERY_FILE_LIST));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment