Improve friend request process and UI
This commit is contained in:
@@ -392,10 +392,17 @@ define([
|
||||
var friendRequests = {};
|
||||
funcs.addFriendRequest = function (data) {
|
||||
var curve = Util.find(data, ['content', 'msg', 'author']);
|
||||
console.log(data);
|
||||
console.log(curve);
|
||||
friendRequests[curve] = data;
|
||||
};
|
||||
funcs.removeFriendRequest = function (hash) {
|
||||
Object.keys(friendRequests).some(function (curve) {
|
||||
var h = Util.find(friendRequests[curve], ['content', 'hash']);
|
||||
if (h === hash) {
|
||||
delete friendRequests[curve];
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
funcs.getFriendRequests = function () {
|
||||
return JSON.parse(JSON.stringify(friendRequests));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user