disable right panel by default, don't perform Twitter https call if panel is disabled

This commit is contained in:
Riccardo Spagni 2016-06-20 21:08:09 +02:00
parent b4fa1762a3
commit 37c1c0bb79
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
2 changed files with 23 additions and 20 deletions

View file

@ -43,7 +43,7 @@ ApplicationWindow {
property var currentItem property var currentItem
property bool whatIsEnable: false property bool whatIsEnable: false
property bool ctrlPressed: false property bool ctrlPressed: false
property bool rightPanelExpanded: true property bool rightPanelExpanded: false
property bool osx: false property bool osx: false
property alias persistentSettings : persistentSettings property alias persistentSettings : persistentSettings
property var wallet; property var wallet;

View file

@ -60,6 +60,8 @@ Item {
if (from == "" && phrase == "") if (from == "" && phrase == "")
return; return;
if (appWindow.rightPanelExpanded) {
//! [requesting] //! [requesting]
var req = new XMLHttpRequest; var req = new XMLHttpRequest;
req.open("GET", "https://api.twitter.com/1.1/search/tweets.json?from=" + from + req.open("GET", "https://api.twitter.com/1.1/search/tweets.json?from=" + from +
@ -85,6 +87,7 @@ Item {
req.send(); req.send();
//! [requesting] //! [requesting]
} }
}
Component.onCompleted: { Component.onCompleted: {