Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgressoRU committed Jun 18, 2015
1 parent add90e1 commit 1800984
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions todo.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ angular.module('todoApp', [])
for (i = 0; i < vm.newRooms.length; i++) {
if (vm.newRooms[i].refresh == 1) {
$http.post('./room_status.php', {room_id: vm.newRooms[i].id}).then(function (response) {
for (i = 0; i < vm.newRooms.length; i++) { //дерьмокод
if (vm.newRooms[i].id == vm.currentRoomId) {
vm.newRooms[i].players = response.data.players;
for (j = 0; j < vm.newRooms.length; j++) { //дерьмокод
if (vm.newRooms[j].id == response.data.id) {
vm.newRooms[j].players = response.data.players;
if (response.data.players > vm.maxPlayers) {
vm.newRooms[i].refresh = 0;
vm.newRooms[j].refresh = 0;
}
vm.newRooms[i].activePlayers = response.data.activePlayers;
vm.newRooms[i].status = response.data.status;
vm.newRooms[j].activePlayers = response.data.activePlayers;
vm.newRooms[j].status = response.data.status;
}
}
})
Expand Down

0 comments on commit 1800984

Please sign in to comment.