fix scroll state handler

This commit is contained in:
Morgan McMillian 2017-11-16 11:23:54 -08:00
parent 18f100b55e
commit baf15b623a
2 changed files with 8 additions and 5 deletions

View file

@ -44,6 +44,7 @@ NavigationPane {
ListView {
id: streamView
property variant listImageManager: feedImageManager
property bool fetching: false
dataModel: ArrayDataModel {
id: postModel
}
@ -129,8 +130,10 @@ NavigationPane {
attachedObjects: [
ListScrollStateHandler {
onAtEndChanged: {
streamView.fetching = false
if (atEnd) {
if (!at_end && pnut.beforeId != 0) {
if (!streamView.fetching && pnut.beforeId != 0) {
streamView.fetching = true
pnut.getStream(endpoint, Pnut.STREAM_OLDER);
}
}

View file

@ -203,22 +203,22 @@
<context>
<name>StreamTab</name>
<message>
<location filename="../assets/StreamTab.qml" line="154"/>
<location filename="../assets/StreamTab.qml" line="161"/>
<source>New Post</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="168"/>
<location filename="../assets/StreamTab.qml" line="175"/>
<source>To Top</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="196"/>
<location filename="../assets/StreamTab.qml" line="203"/>
<source>To Bottom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/StreamTab.qml" line="183"/>
<location filename="../assets/StreamTab.qml" line="190"/>
<source>Reload</source>
<translation type="unfinished"></translation>
</message>