Skip to content

Commit

Permalink
Fix votekick threshold due to API change (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorfieeee authored Sep 4, 2024
1 parent 846c4b2 commit 030fe47
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rcongui/src/components/SettingsView/hllSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import NumSlider from "./numSlider";
import Padlock from "../shared/padlock";
import AutoRefreshLine from "../autoRefreshLine";
import { ForwardCheckBox, WordList } from "../commonComponent";
import { chunk } from "lodash";

const ProfanityFiler = ({
words,
Expand Down Expand Up @@ -254,8 +255,12 @@ class HLLSettings extends React.Component {
}

async saveVotekickThreshold() {
const threshold_pairs = chunk(this.state.votekickThreshold
.split(",")
.map(n => Number(n.trim())), 2)

return postData(`${process.env.REACT_APP_API_URL}set_votekick_thresholds`, {
threshold_pairs: this.state.votekickThreshold,
threshold_pairs,
})
.then((res) => showResponse(res, "set_votekick_thresholds", true))
.then(this.loadVotekickThreshold)
Expand Down

0 comments on commit 030fe47

Please sign in to comment.