Skip to content

Commit

Permalink
Remove unnecessary test function
Browse files Browse the repository at this point in the history
  • Loading branch information
resultingforce committed Apr 1, 2019
1 parent a6818d5 commit 2856240
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions app/src/components/routes/messenger/p2p-messages-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
</div>
</div>
<md-button id="generateTestMessagesBtn" ng-click="vm.generateTestMessages($event)"></md-button>
`
})
@Inject('$scope','$q','$timeout','$document','heat','user','settings',
Expand Down Expand Up @@ -181,28 +180,6 @@ class P2PMessagesViewerComponent {
return item;
}

generateTestMessages(event) {
let running = this["runningTest"];
if (running) {
clearInterval(this["runningTest"]);
this["runningTest"] = null;
return;
}
let room = this.p2pMessaging.getOneToOneRoom(this.publickey, true);
if (room) {
let n = 0;
this["runningTest"] = setInterval(() => {
if (Math.random() > 0.1) return;
let s = "";
for (let i = 0; i < Math.random()*150; i++) {
s = s + " " + Math.random().toString(36).substring(2);
}
room.sendMessage({timestamp: Date.now(), type: "chat", text: `${n} ${s}`});
n++;
}, 150);
}
}

}

class P2PMessagesDataSource {
Expand Down

0 comments on commit 2856240

Please sign in to comment.