Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mond1c committed Dec 9, 2023
1 parent d8431c1 commit 1cbd387
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/frontend/admin/src/components/SniperLocator.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,19 @@ const SniperViewManager = ({ service }) => {
}
}, [selectedInstance]);

const [selectedTeamName, selectedTeamCdsId] = useMemo(() => {
if (selectedTeamId === undefined) {
return ["", null];
}
const team = teams.find(team => team.id === selectedTeamId);
return [team?.name ?? "", team?.contestSystemId];
}, [teams, selectedTeamId]);

const onMove = useCallback(() => {
const settings = {
sniperId: sniper,
teamId: selectedTeamId,
teamId: selectedTeamCdsId,
};
console.log(settings);
service.moveWithSettings(settings);
setSelectedInstance(undefined);
setSelectedTeamId(undefined);
Expand All @@ -158,7 +165,7 @@ const SniperViewManager = ({ service }) => {
const onShow = useCallback(() => {
const settings = {
sniperId: sniper,
teamId: selectedTeamId,
teamId: selectedTeamCdsId,
};
service.showWithSettings(settings);
setSelectedInstance(undefined);
Expand All @@ -169,13 +176,6 @@ const SniperViewManager = ({ service }) => {
service.hide();
}, [service]);

const selectedTeamName = useMemo(() => {
if (selectedTeamId === undefined) {
return "";
}
return teams.find(team => team.id === selectedTeamId).name;
}, [teams, selectedTeamId]);

return (
<Box>
<Box sx={{ mb: 1 }} display="flex" flexWrap="wrap" justifyContent="space-between" alignItems="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ object Util {
}

fun loadLocatorPoints(sniperNumber: Int): List<LocatorPoint> {
val scanner = Scanner(Config.configDirectory.resolve("/coordinates-$sniperNumber.txt"))
val scanner = Scanner(Config.configDirectory.resolve("coordinates-$sniperNumber.txt").toFile())
val n = scanner.nextInt()

val allPoints = mutableListOf<LocatorPoint>()
Expand Down

0 comments on commit 1cbd387

Please sign in to comment.