diff --git a/retroshare-qml-app/src/qml/TrustedNodesView.qml b/retroshare-qml-app/src/qml/TrustedNodesView.qml index e7607d733..82f18ec8b 100644 --- a/retroshare-qml-app/src/qml/TrustedNodesView.qml +++ b/retroshare-qml-app/src/qml/TrustedNodesView.qml @@ -24,14 +24,20 @@ import "jsonpath.js" as JSONPath Item { id: trustedNodesView + property int token: 0 - function refreshData() - { - rsApi.request("/peers/*", "", - function(par) { jsonModel.json = par.response }) - } + Component.onCompleted: refreshData() onFocusChanged: focus && refreshData() + function refreshDataCallback(par) + { + jsonModel.json = par.response + token = JSON.parse(par.response).statetoken + mainWindow.registerToken(token, refreshData) + } + function refreshData() + { if(visible) rsApi.request("/peers/*", "", refreshDataCallback) } + JSONListModel { id: jsonModel @@ -136,13 +142,4 @@ Item onClicked: stackView.push("qrc:/qml/AddTrustedNode.qml") width: parent.width } - - Timer - { - interval: 800 - repeat: true - triggeredOnStart: true - onTriggered: if(trustedNodesView.visible) trustedNodesView.refreshData() - Component.onCompleted: start() - } }