mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-29 19:13:49 +01:00
fix donation
This commit is contained in:
parent
3a7c64872a
commit
c1945ab12e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -52,6 +52,7 @@ export function DonateOption(props: IProps): React.ReactElement {
|
|||||||
const amt = numeralWrapper.parseMoney(event.target.value);
|
const amt = numeralWrapper.parseMoney(event.target.value);
|
||||||
if (event.target.value === "" || isNaN(amt)) setDonateAmt(null);
|
if (event.target.value === "" || isNaN(amt)) setDonateAmt(null);
|
||||||
else setDonateAmt(amt);
|
else setDonateAmt(amt);
|
||||||
|
console.log('set')
|
||||||
}
|
}
|
||||||
|
|
||||||
function donate(): void {
|
function donate(): void {
|
||||||
|
@ -70,12 +70,6 @@ export function FactionRoot(props: IProps): React.ReactElement {
|
|||||||
function rerender(): void {
|
function rerender(): void {
|
||||||
setRerender((old) => !old);
|
setRerender((old) => !old);
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const id = setInterval(rerender, 1000);
|
|
||||||
return () => clearInterval(id);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const faction = props.faction;
|
const faction = props.faction;
|
||||||
|
|
||||||
const player = use.Player();
|
const player = use.Player();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* React component for general information about the faction. This includes the
|
* React component for general information about the faction. This includes the
|
||||||
* factions "motto", reputation, favor, and gameplay instructions
|
* factions "motto", reputation, favor, and gameplay instructions
|
||||||
*/
|
*/
|
||||||
import * as React from "react";
|
import React, {useState, useEffect} from "react";
|
||||||
|
|
||||||
import { Faction } from "../../Faction/Faction";
|
import { Faction } from "../../Faction/Faction";
|
||||||
import { FactionInfo } from "../../Faction/FactionInfo";
|
import { FactionInfo } from "../../Faction/FactionInfo";
|
||||||
@ -34,6 +34,16 @@ const useStyles = makeStyles((theme: Theme) =>
|
|||||||
);
|
);
|
||||||
|
|
||||||
export function Info(props: IProps): React.ReactElement {
|
export function Info(props: IProps): React.ReactElement {
|
||||||
|
const setRerender = useState(false)[1];
|
||||||
|
function rerender(): void {
|
||||||
|
setRerender((old) => !old);
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const id = setInterval(rerender, 1000);
|
||||||
|
return () => clearInterval(id);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
const favorGain = props.faction.getFavorGain()[0];
|
const favorGain = props.faction.getFavorGain()[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user