prevent network requests when images are being hidden
This commit is contained in:
parent
cf0919d06a
commit
49d58341c3
3 changed files with 6 additions and 8 deletions
|
@ -54,7 +54,7 @@ Container {
|
|||
attachedObjects: [
|
||||
NetImageTracker {
|
||||
id: tracker
|
||||
source: ListItemData.user.content.avatar_image.link
|
||||
source: (postitem.ListItem.view.hidePhoto()) ? "" : ListItemData.user.content.avatar_image.link
|
||||
manager: postitem.ListItem.view.listImageManager
|
||||
}
|
||||
]
|
||||
|
@ -179,7 +179,7 @@ Container {
|
|||
manager: postitem.ListItem.view.listImageManager
|
||||
source: {
|
||||
var photo_url = ""
|
||||
if (typeof ListItemData.raw !== "undefined") {
|
||||
if (typeof ListItemData.raw !== "undefined" && !postitem.ListItem.view.hidePhoto()) {
|
||||
ListItemData.raw.forEach(function (item) {
|
||||
if (item["type"] == "io.pnut.core.oembed") {
|
||||
if (item["value"]["type"] == "photo") {
|
||||
|
|
|
@ -121,10 +121,8 @@ NavigationPane {
|
|||
}
|
||||
function hidePhoto() {
|
||||
if (_app.setting("hidephoto") === "true") {
|
||||
console.log("HIDE IT!")
|
||||
return true
|
||||
} else {
|
||||
console.log("show me da photos")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,22 +213,22 @@
|
|||
<context>
|
||||
<name>StreamTab</name>
|
||||
<message>
|
||||
<location filename="../assets/StreamTab.qml" line="164"/>
|
||||
<location filename="../assets/StreamTab.qml" line="162"/>
|
||||
<source>New Post</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../assets/StreamTab.qml" line="178"/>
|
||||
<location filename="../assets/StreamTab.qml" line="176"/>
|
||||
<source>To Top</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../assets/StreamTab.qml" line="206"/>
|
||||
<location filename="../assets/StreamTab.qml" line="204"/>
|
||||
<source>To Bottom</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../assets/StreamTab.qml" line="193"/>
|
||||
<location filename="../assets/StreamTab.qml" line="191"/>
|
||||
<source>Reload</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
Reference in a new issue