mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
collection iterator is now async, it needs to run the new record's download filter
This commit is contained in:
parent
fb99c9f85e
commit
69074b307e
@ -137,13 +137,20 @@ CollectionIterator.prototype = {
|
|||||||
|
|
||||||
get count() { return this._coll.data.length; },
|
get count() { return this._coll.data.length; },
|
||||||
|
|
||||||
next: function CollIter_next() {
|
next: function CollIter_next(onComplete) {
|
||||||
if (this._idx >= this.count)
|
let fn = function CollIter__next() {
|
||||||
return null;
|
let self = yield;
|
||||||
let item = this._coll.data[this._idx++];
|
|
||||||
let wrap = new CryptoWrapper(this._coll.uri.resolve(item.id));
|
if (this._idx >= this.count)
|
||||||
wrap.data = item;
|
return;
|
||||||
return wrap;
|
let item = this._coll.data[this._idx++];
|
||||||
|
let wrap = new CryptoWrapper(this._coll.uri.resolve(item.id));
|
||||||
|
wrap.data = this._coll._json.encode(item); // HACK HACK HACK
|
||||||
|
yield wrap.filterDownload(self.cb); // XXX EEK
|
||||||
|
|
||||||
|
self.done(wrap);
|
||||||
|
};
|
||||||
|
fn.async(this, onComplete);
|
||||||
},
|
},
|
||||||
|
|
||||||
reset: function CollIter_reset() {
|
reset: function CollIter_reset() {
|
||||||
|
Loading…
Reference in New Issue
Block a user