Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_openAddPlayer(league) {
Amplitude.logEventWithProperties("OpenCreatePlayer", {
leagueId: league.id
});
this.props.navigation.navigate("AddPlayer", {
players: league.players,
leagueId: league.id
});
setTimeout(() => this.setState({ selectedTab: "Table" }), 200);
}
export function track(event: string, options?: TrackingOptions): void {
initialize();
const properties = normalizeTrackingOptions(options);
if (properties) {
Amplitude.logEventWithProperties(event, properties);
} else {
Amplitude.logEvent(event);
}
}
_openLeague(leagueId, allLeagues) {
if (this.props.navigation.isFocused()) {
const league = allLeagues.find(league => league.id === leagueId);
Amplitude.logEventWithProperties("OpenLeague", { leagueId });
this.props.navigation.navigate("League", {
leagueId,
leagueTitle: league.title
});
}
}
_openGame(game) {
Amplitude.logEventWithProperties("OpenGame", {
leagueId: this.props.leagueId,
gameId: game.id
});
this.props.navigation.navigate("Game", {
game,
leagueId: this.props.leagueId
});
}
onPress: async () => {
await removeLeagueId({ variables: { leagueId } });
Amplitude.logEventWithProperties("RemoveLeague", {
leagueId
});
resolve(true);
}
}
const wrappedAddLeagueId = async leagueId => {
await addLeagueId({ leagueId });
Amplitude.logEventWithProperties("AddLeagueFromQRCode", {
leagueId
});
this.props.navigation.goBack();
};
let content;
_openPlayer(player) {
const { leagueId } = this.props.leagueId;
Amplitude.logEventWithProperties("OpenPlayer", {
leagueId,
playerId: player.id
});
this.props.navigation.navigate("Player", {
player,
leagueId
});
}
onPress: async () => {
Amplitude.logEventWithProperties("AddLeagueFromLink", {
leagueId
});
await this.props.addLeagueIdMutation({ variables: { leagueId } });
this.props.openLeaguesList();
}
},
_shareLeague = () => {
const { leagueId, leagueTitle } = this.props;
Amplitude.logEventWithProperties("OpenShareLeague", {
leagueId
});
this.props.navigation.navigate("ShareLeague", {
leagueId,
leagueTitle
});
};