Skip to content

Commit

Permalink
Merge pull request #790 from MarechJ/fix/useRef_lodash
Browse files Browse the repository at this point in the history
Fix import of React.useRef and lodash range
  • Loading branch information
FlorianSW authored Dec 17, 2024
2 parents feb9c08 + c0664c4 commit 17d49a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
3 changes: 2 additions & 1 deletion rcongui/src/components/PlayerView/playerActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import VisibilityIcon from "@mui/icons-material/Visibility";
import BlockIcon from "@mui/icons-material/Block";
import StarIcon from "@mui/icons-material/Star";
import {Component, Fragment, useState} from "react";
import range from "lodash/range";

const Duration = ({
durationNumber,
Expand Down Expand Up @@ -297,7 +298,7 @@ const PlayerActions = ({
) : (
""
)}
{_.range(show).map((idx) => (
{range(show).map((idx) => (
<Button
key={actions[idx][0]}
disabled={disable && !actions[idx][0].startsWith("switch")}
Expand Down
25 changes: 0 additions & 25 deletions rcongui/src/pages/records/game-logs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,31 +272,6 @@ class LogsHistory extends Component {
});
}

handleDownload() {
postData(`${process.env.REACT_APP_API_URL}get_historical_logs_csv`, {
player_name: this.state.name,
action: this.state.type,
player_id: this.state.playerId,
from: this.state.from,
till: this.state.till,
limit: this.state.limit,
time_sort: this.state.timeSort,
exact_player: this.state.exactPlayer,
exact_action: this.state.exactAction,
server_filter: this.state.server,
})
.then((res) => res.blob())
.then((blob) => {
const url = window.URL.createObjectURL(new Blob([blob]));
const link = document.createElement("a");
link.href = url;
link.setAttribute("download", `log.csv`);
document.body.appendChild(link);
link.click();
link.parentNode.removeChild(link);
});
}

componentDidMount() {
this.getHistoricalLogs();
}
Expand Down
2 changes: 1 addition & 1 deletion rcongui/src/pages/views/team/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Fragment, useEffect, useMemo, useState} from "react";
import {Fragment, useEffect, useMemo, useRef, useState} from "react";
import {
Link,
Typography,
Expand Down

0 comments on commit 17d49a2

Please sign in to comment.