diff --git a/WebKit/scripts/controller/Timeline.js b/WebKit/scripts/controller/Timeline.js index c2264a7..da16564 100644 --- a/WebKit/scripts/controller/Timeline.js +++ b/WebKit/scripts/controller/Timeline.js @@ -75,17 +75,16 @@ function(Core, APICalls, HostApp, URI) { if(!append) { this.since_id = status.id; this.since_id_entity = status.entity; - this.since_time = status.received_at; + //this.since_time = status.received_at; + this.since_time = status.version.received_at; } - - // if(status.id == "vBf0UALAJ97LnvJN4f6sBw") debug(status); - if (status.type.startsWith("https://tent.io/types/status/v0#")) { var new_node = this.getStatusDOMElement(status, _statuses.refs); - - if (!document.getElementById(new_node.id)) { + var old_node = document.getElementById(new_node.id); + + if (!old_node) { if(!append && this.body.childNodes.length > 0) { if(this.body.childNodes.length > this.max_length) { @@ -99,6 +98,9 @@ function(Core, APICalls, HostApp, URI) { this.body.appendChild(new_node); } + } else { + debug(new_node.id); + old_node.parentNode.replaceChild(new_node, old_node); } } else if (status.type == "https://tent.io/types/delete/v0#") { @@ -138,6 +140,7 @@ function(Core, APICalls, HostApp, URI) { uri.addSearch("limit", this.posts_limit); uri.addSearch("max_refs", 20); uri.addSearch("profiles", "entity"); + uri.addSearch("sort_by", "version.received_at"); if(this.since_time) { uri.addSearch("since", this.since_time);