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

View file

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