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; },
|
||||
|
||||
next: function CollIter_next() {
|
||||
if (this._idx >= this.count)
|
||||
return null;
|
||||
let item = this._coll.data[this._idx++];
|
||||
let wrap = new CryptoWrapper(this._coll.uri.resolve(item.id));
|
||||
wrap.data = item;
|
||||
return wrap;
|
||||
next: function CollIter_next(onComplete) {
|
||||
let fn = function CollIter__next() {
|
||||
let self = yield;
|
||||
|
||||
if (this._idx >= this.count)
|
||||
return;
|
||||
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user