use peering request

This commit is contained in:
j 2016-01-13 15:22:25 +05:30
parent 614a562f3c
commit cb4ba86bac
2 changed files with 18 additions and 21 deletions

View file

@ -347,15 +347,11 @@ oml.ui.folders = function() {
Ox.print('got change event')
Ox.Request.clearCache();
},
'peering.accept': function(data) {
Ox.print('peering.accept reload list')
Ox.Request.clearCache('getUsers');
that.updateElement();
},
'peering.remove': function(data) {
Ox.print('peering.remove reload list')
peering: function(data, event) {
Ox.Request.clearCache('getUsers');
if (Ox.contains(['peering.accept', 'peering.remove'], event)) {
that.updateElement();
}
},
status: function(data) {
if (data.id == oml.user.id) {

View file

@ -39,16 +39,16 @@ oml.ui.peersButton = function() {
.appendTo(that);
oml.bindEvent({
'peering.request': update,
'peering.accept': update,
'peering.reject': update
peering: update
});
update();
function open() {
oml.UI.set({page: 'users'});
oml.UI.set({page: 'peers'});
}
function update() {
// wait for clearCache in folder.js
setTimeout(function() {
oml.api.getUsers(function(result) {
requests = result.data.users.filter(function(user) {
return user.pending=="received";
@ -60,6 +60,7 @@ oml.ui.peersButton = function() {
: 'No peering requests')
});
});
});
}
return that;