From 49d58341c35e305fefe3955cd62dca21f47575f6 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Thu, 16 Nov 2017 17:03:29 -0800 Subject: [PATCH] prevent network requests when images are being hidden --- assets/PostItem.qml | 4 ++-- assets/StreamTab.qml | 2 -- translations/Goober.ts | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/assets/PostItem.qml b/assets/PostItem.qml index 6457738..3d24d22 100644 --- a/assets/PostItem.qml +++ b/assets/PostItem.qml @@ -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") { diff --git a/assets/StreamTab.qml b/assets/StreamTab.qml index 86923a5..29e48ce 100644 --- a/assets/StreamTab.qml +++ b/assets/StreamTab.qml @@ -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 } } diff --git a/translations/Goober.ts b/translations/Goober.ts index 7959efe..0adc767 100644 --- a/translations/Goober.ts +++ b/translations/Goober.ts @@ -213,22 +213,22 @@ StreamTab - + New Post - + To Top - + To Bottom - + Reload