Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardpepa committed Jun 19, 2022
1 parent 009f21d commit a8e9920
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions WeBall-Statistics-Mobile/.idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public class DAOLiveMatchService implements DAOCRUDService<TeamLiveStatistics> {
public static DAOLiveMatchService instance;
private final DatabaseReference databaseReference;
private ValueEventListener listenerForPlayer;

private DAOLiveMatchService() {
FirebaseDatabase db = FirebaseDatabase.getInstance();
Expand Down Expand Up @@ -172,7 +173,12 @@ public void onCancelled(@NonNull DatabaseError error) {
}

public void setDataListenerForPlayer(LivePlayerStatistics fragment, int matchId, int teamId1) {
databaseReference.addValueEventListener(new ValueEventListener() {

if (listenerForPlayer != null) {
databaseReference.removeEventListener(listenerForPlayer);
}

listenerForPlayer = new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
// this method is call to get the realtime
Expand Down Expand Up @@ -206,7 +212,8 @@ public void onCancelled(@NonNull DatabaseError error) {
// calling on cancelled method when we receive
// any error or we are not able to get the data.
}
});
};
databaseReference.addValueEventListener(listenerForPlayer);
}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class Config {

public static final String IP = "172.21.48.1";
public static final String IP = "172.26.208.1";
public static final String API_URL = "http://" + IP + "/WeBall_Statistics-Backend/API/";
public static final String MATCHES_API = "http://" + IP + "/weBall_Statistics-Backend/API/match.php";
public static final String API_REFEREE = "referee.php";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
<domain includeSubdomains="true">10.4.22.16</domain>
<domain includeSubdomains="true">172.21.80.1</domain>
<domain includeSubdomains="true">192.168.2.66</domain>
<domain includeSubdomains="true">172.25.192.1</domain>
<domain includeSubdomains="true">192.168.1.3</domain>
<domain includeSubdomains="true">192.168.0.119</domain>
<domain includeSubdomains="true">172.27.0.1</domain>
<domain includeSubdomains="true">172.21.48.1</domain>
<domain includeSubdomains="true">172.26.208.1</domain>
</domain-config>
</network-security-config>

0 comments on commit a8e9920

Please sign in to comment.