slightly tweak thread creation algo
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQT/foVVmI9pK13hPWFohAcXSWbK8wUCZomQVAAKCRBohAcXSWbK 86w1AQDsT+lPIbu6YbFaqlTJ34okd8NXROMZidBA62eEgNNciAD+K2G5CZYc9o0p 4TLD6bMB3VV2vIPf5xrcmEn9uRHfDQo= =+W2L -----END PGP SIGNATURE-----
2 files changed,
12 insertions(+),
7 deletions(-)
M
ts/adapter-element.ts
→
ts/adapter-element.ts
@@ -206,6 +206,17 @@ this._threads.push(new MessageThread(msg));
return msg.id; } + // then, we should check if its parent is an orphan + const orphanedParent = this._orphans.find(o=>o.id == msg.replyTo); + if (orphanedParent) { + // then, try to place them both + + if (this.placeMsg(orphanedParent.id)) { + this._orphans.splice(this._orphans.indexOf(orphanedParent), 1); + return this.placeMsg(msg); + } + } + // otherwise we can orphan it and try to fill it in later if (this._orphans.filter(o=>o.id == msg.id).length == 0) { this._orphans.push(msg);
M
ts/websocket.ts
→
ts/websocket.ts
@@ -37,16 +37,10 @@ break;
default: break; } - // if the adapter is active, inject the web components + // if the adapter is active signal it that there's new data let adapter = $(`adapter_${data.adapter}`); if (adapter) { adapter.setAttribute("data-latest", data.id); - } - // FOR HOTFETCHED DATA: - // before fetching, we can set properties on the DOM, - // so when those data return to us we know where to inject components! - if (_("currentAdapter") == data.adapter) { - // dive in and insert that shit in the dom } } });