[Fix] search for tags and persons added header call for max/min and prepend on first call.
This commit is contained in:
parent
4741e7f707
commit
32bde3b342
4 changed files with 14 additions and 28 deletions
|
@ -1,6 +1,6 @@
|
||||||
Qt.include("Mastodon.js")
|
Qt.include("Mastodon.js")
|
||||||
|
|
||||||
var debug = true;
|
var debug = false;
|
||||||
var loadImages = true;
|
var loadImages = true;
|
||||||
// used to dedupe on append/insert
|
// used to dedupe on append/insert
|
||||||
var knownIds = [];
|
var knownIds = [];
|
||||||
|
@ -62,7 +62,9 @@ WorkerScript.onMessage = function(msg) {
|
||||||
* this falls through and continues for GET
|
* this falls through and continues for GET
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (msg.action === "bookmarks" || ( msg.action === "timelines/home" && msg.mode === "append") ){
|
if (msg.action === "bookmarks" ||
|
||||||
|
( msg.action === "timelines/home" && msg.mode === "append") ||
|
||||||
|
( msg.action.indexOf("timelines/tag/") !== -1 ) ){
|
||||||
API.getLink(msg.action, msg.params, function(data) {
|
API.getLink(msg.action, msg.params, function(data) {
|
||||||
if (debug) console.log(JSON.stringify(data))
|
if (debug) console.log(JSON.stringify(data))
|
||||||
WorkerScript.sendMessage({ 'LinkHeader': data })
|
WorkerScript.sendMessage({ 'LinkHeader': data })
|
||||||
|
|
|
@ -158,19 +158,11 @@ Page {
|
||||||
delegate: VisualContainer
|
delegate: VisualContainer
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
view.type = "timelines/tag/"+tlSearch.search.substring(1)
|
view.type = "timelines/tag/"+tlSearch.search.substring(1)
|
||||||
var ids = []
|
|
||||||
view.params = []
|
|
||||||
view.params.push({name: 'limit', data: "20" });
|
|
||||||
/* we push the ids via params which we remove in the WorkerScript
|
|
||||||
* see: MyList:loadData() and should move */
|
|
||||||
if (mdl.count) {
|
if (mdl.count) {
|
||||||
for(var i = 0 ; i < mdl.count ; i++) {
|
|
||||||
ids.push(mdl.get(i).id)
|
|
||||||
//if (debug) console.log(model.get(i).id)
|
|
||||||
}
|
|
||||||
view.params.push({name: 'ids', data: ids });
|
|
||||||
}
|
|
||||||
view.loadData("append")
|
view.loadData("append")
|
||||||
|
} else {
|
||||||
|
view.loadData("prepend")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,25 +233,17 @@ Page {
|
||||||
|
|
||||||
delegate: VisualContainer
|
delegate: VisualContainer
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var ids = []
|
|
||||||
view3.params = []
|
|
||||||
view3.params.push({name: 'limit', data: "20" });
|
|
||||||
/* we push the ids via params which we remove in the WorkerScript
|
|
||||||
* see: MyList:loadData() and should move */
|
|
||||||
if (mdl.count) {
|
|
||||||
for(var i = 0 ; i < mdl.count ; i++) {
|
|
||||||
ids.push(mdl.get(i).id)
|
|
||||||
//if (debug) console.log(model.get(i).id)
|
|
||||||
}
|
|
||||||
view3.params.push({name: 'ids', data: ids });
|
|
||||||
}
|
|
||||||
view3.type = "timelines/tag/"+tlSearch.search
|
view3.type = "timelines/tag/"+tlSearch.search
|
||||||
|
if (mdl.count) {
|
||||||
|
view3.loadData("append")
|
||||||
|
} else {
|
||||||
view3.loadData("prepend")
|
view3.loadData("prepend")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SlideshowView {
|
SlideshowView {
|
||||||
id: slideshow
|
id: slideshow
|
||||||
|
|
|
@ -7,7 +7,7 @@ import "."
|
||||||
SilicaListView {
|
SilicaListView {
|
||||||
id: myList
|
id: myList
|
||||||
|
|
||||||
property bool debug: true
|
property bool debug: false
|
||||||
property string type
|
property string type
|
||||||
property string title
|
property string title
|
||||||
property string description
|
property string description
|
||||||
|
|
|
@ -13,7 +13,7 @@ Name: harbour-tooterb
|
||||||
%{!?qtc_make:%define qtc_make make}
|
%{!?qtc_make:%define qtc_make make}
|
||||||
%{?qtc_builddir:%define _builddir %qtc_builddir}
|
%{?qtc_builddir:%define _builddir %qtc_builddir}
|
||||||
Summary: Tooter β
|
Summary: Tooter β
|
||||||
Version: 1.1.3
|
Version: 1.1.4
|
||||||
Release: 1
|
Release: 1
|
||||||
Group: Qt/Qt
|
Group: Qt/Qt
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
|
|
Loading…
Reference in a new issue