Skip to content

Commit

Permalink
[Fix] search for tags and persons added header call for max/min and p…
Browse files Browse the repository at this point in the history
…repend on first call.
  • Loading branch information
poetaster committed Jan 18, 2023
1 parent 4741e7f commit 32bde3b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
6 changes: 4 additions & 2 deletions qml/lib/Worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Qt.include("Mastodon.js")

var debug = true;
var debug = false;
var loadImages = true;
// used to dedupe on append/insert
var knownIds = [];
Expand Down Expand Up @@ -62,7 +62,9 @@ WorkerScript.onMessage = function(msg) {
* 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) {
if (debug) console.log(JSON.stringify(data))
WorkerScript.sendMessage({ 'LinkHeader': data })
Expand Down
30 changes: 7 additions & 23 deletions qml/pages/MainPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,11 @@ Page {
delegate: VisualContainer
Component.onCompleted: {
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) {
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")
} else {
view.loadData("prepend")
}
view.loadData("append")
}
}
}
Expand Down Expand Up @@ -241,20 +233,12 @@ Page {

delegate: VisualContainer
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 */
view3.type = "timelines/tag/"+tlSearch.search
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.loadData("append")
} else {
view3.loadData("prepend")
}
view3.type = "timelines/tag/"+tlSearch.search
view3.loadData("prepend")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion qml/pages/components/MyList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "."
SilicaListView {
id: myList

property bool debug: true
property bool debug: false
property string type
property string title
property string description
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-tooterb.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name: harbour-tooterb
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Tooter β
Version: 1.1.3
Version: 1.1.4
Release: 1
Group: Qt/Qt
License: GPLv3
Expand Down

0 comments on commit 32bde3b

Please sign in to comment.