Skip to content

Commit

Permalink
fix: blood bonus can not set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Jun 5, 2023
1 parent c39b56e commit 3ab76f5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/GZCTF/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
"form-data": "~4.0.0",
"lodash": "^4.17.21",
"prettier": "~2.8.8",
"rollup": "^3.23.0",
"rollup": "^3.23.1",
"swagger-typescript-api": "^12.0.4",
"tslib": "^2.5.3",
"typescript": "5.1.3",
"vite": "^4.3.9",
"vite-plugin-pages": "^0.30.1",
"vite-plugin-pages": "^0.31.0",
"vite-plugin-prismjs": "^0.0.8",
"vite-plugin-webfont-dl": "^3.7.4"
}
Expand Down
24 changes: 12 additions & 12 deletions src/GZCTF/ClientApp/pnpm-lock.yaml

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

6 changes: 3 additions & 3 deletions src/GZCTF/ClientApp/src/components/admin/BloodBonusModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const BloodBonusModel: FC<ModalProps> = (props) => {
max={100}
disabled={disabled}
value={firstBloodBonus / 10}
onChange={(value) => value && setFirstBloodBonus(Math.floor(value * 10))}
onChange={(value) => typeof value === "number" && setFirstBloodBonus(Math.floor(value * 10))}
/>
<NumberInput
label="二血奖励 (%)"
Expand All @@ -70,7 +70,7 @@ const BloodBonusModel: FC<ModalProps> = (props) => {
max={100}
disabled={disabled}
value={secondBloodBonus / 10}
onChange={(value) => value && setSecondBloodBonus(Math.floor(value * 10))}
onChange={(value) => typeof value === "number" && setSecondBloodBonus(Math.floor(value * 10))}
/>
<NumberInput
label="三血奖励 (%)"
Expand All @@ -81,7 +81,7 @@ const BloodBonusModel: FC<ModalProps> = (props) => {
max={100}
disabled={disabled}
value={thirdBloodBonus / 10}
onChange={(value) => value && setThirdBloodBonus(Math.floor(value * 10))}
onChange={(value) => typeof value === "number" && setThirdBloodBonus(Math.floor(value * 10))}
/>
<Group grow m="auto" w="100%">
<Button fullWidth disabled={disabled} onClick={onUpdate}>
Expand Down

0 comments on commit 3ab76f5

Please sign in to comment.