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: [
|
attachedObjects: [
|
||||||
NetImageTracker {
|
NetImageTracker {
|
||||||
id: tracker
|
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
|
manager: postitem.ListItem.view.listImageManager
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -179,7 +179,7 @@ Container {
|
||||||
manager: postitem.ListItem.view.listImageManager
|
manager: postitem.ListItem.view.listImageManager
|
||||||
source: {
|
source: {
|
||||||
var photo_url = ""
|
var photo_url = ""
|
||||||
if (typeof ListItemData.raw !== "undefined") {
|
if (typeof ListItemData.raw !== "undefined" && !postitem.ListItem.view.hidePhoto()) {
|
||||||
ListItemData.raw.forEach(function (item) {
|
ListItemData.raw.forEach(function (item) {
|
||||||
if (item["type"] == "io.pnut.core.oembed") {
|
if (item["type"] == "io.pnut.core.oembed") {
|
||||||
if (item["value"]["type"] == "photo") {
|
if (item["value"]["type"] == "photo") {
|
||||||
|
|
|
@ -121,10 +121,8 @@ NavigationPane {
|
||||||
}
|
}
|
||||||
function hidePhoto() {
|
function hidePhoto() {
|
||||||
if (_app.setting("hidephoto") === "true") {
|
if (_app.setting("hidephoto") === "true") {
|
||||||
console.log("HIDE IT!")
|
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
console.log("show me da photos")
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,22 +213,22 @@
|
||||||
<context>
|
<context>
|
||||||
<name>StreamTab</name>
|
<name>StreamTab</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../assets/StreamTab.qml" line="164"/>
|
<location filename="../assets/StreamTab.qml" line="162"/>
|
||||||
<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="178"/>
|
<location filename="../assets/StreamTab.qml" line="176"/>
|
||||||
<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="206"/>
|
<location filename="../assets/StreamTab.qml" line="204"/>
|
||||||
<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="193"/>
|
<location filename="../assets/StreamTab.qml" line="191"/>
|
||||||
<source>Reload</source>
|
<source>Reload</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Reference in a new issue