From fed70a441c85b75baca871f1a5907580dcad3311 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Mon, 15 Jul 2019 14:09:28 +0530 Subject: [PATCH] fix bug: not retriving self tweets from selfserver --- app/web/home.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/web/home.js b/app/web/home.js index 71918a5..a3df73a 100644 --- a/app/web/home.js +++ b/app/web/home.js @@ -37,6 +37,8 @@ function userDataStartUp(){ listProfiles(); getFollowinglistFromIDB().then(function(result){ following = result; + if(!following.includes(selfID)) + following.push(selfID); console.log(following); displayTweetsFromIDB().then(function(result){ connectToAllFollowing(); @@ -361,9 +363,7 @@ function postTweet(){ var data = JSON.stringify({floID:selfID,time:time,tweet:tweet,sign:sign}); console.log(data); selfWebsocket.send(data); - createTweetElement(selfID,time,tweet); getLastTweetCount(selfID).then(function(result){ - storeTweet({floID:selfID,time:time,data:tweet},result+1); sendTweetToSuperNode(data,result+1); }).catch(function(error){ console.log(error.message); @@ -477,8 +477,8 @@ function createTweetElement(floID,time,tweet){ function connectToAllFollowing(){ console.log("Connecting to All following servers...") - for(i=0;i { + console.log(floid) followingWebSockets[floid] = new WebSocket("ws://"+profiles[floid].onionAddr+"/ws"); followingWebSockets[floid].onopen = function(ev){ @@ -512,7 +512,7 @@ function connectToAllFollowing(){ console.log(error.message); } }; - } + }); } function getLastTweetCount(floid){