@@ -93,13 +93,17 @@ app.controller('GlobalController', function ($scope, $timeout) {
93
93
return showError ( err )
94
94
} )
95
95
96
+ $scope . filterPlayers = function filterPlayers ( game ) {
97
+ return function ( player ) {
98
+ return player . UserId !== '0' && player . UserId !== game . CurrentTurn . UserId
99
+ }
100
+ }
101
+
96
102
} )
97
103
98
104
app . controller ( 'GameInfoController' , function ( $scope , $timeout ) {
99
105
$scope . timeRemaining = '9000 years'
100
106
101
- $scope . filterPlayers = filterPlayers ( $scope . selectedGame )
102
-
103
107
$scope . $on ( 'selectedGameWasUpdated' , ( ) => {
104
108
const timeRemaining = moment ( $scope . selectedGame . CurrentTurn . Expires ) . fromNow ( true )
105
109
if ( ! timeRemaining ) {
@@ -135,9 +139,7 @@ app.controller('GameInfoController', function ($scope, $timeout) {
135
139
136
140
} )
137
141
138
- app . controller ( 'GameListController' , function ( $scope ) {
139
- return $scope . filterPlayers = filterPlayers
140
- } )
142
+ app . controller ( 'GameListController' , function ( $scope ) { } )
141
143
142
144
app . controller ( 'SettingsController' , function ( $scope ) {
143
145
$scope . settings = gmr . getSettings ( )
@@ -166,9 +168,3 @@ app.controller('SettingsController', function ($scope) {
166
168
$scope . settings = gmr . getSettings ( )
167
169
}
168
170
} )
169
-
170
- function filterPlayers ( game ) {
171
- return function ( player ) {
172
- return player . UserId !== '0' && player . UserId !== game . CurrentTurn . UserId
173
- }
174
- }
0 commit comments