mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Merge pull request #2878 from phyzical/bugfix/fix-ui-gang-member-task
Fix for ui of gang members current task when set via api
This commit is contained in:
commit
b295dd084d
@ -21,6 +21,13 @@ export function TaskSelector(props: IProps): React.ReactElement {
|
|||||||
const gang = useGang();
|
const gang = useGang();
|
||||||
const [currentTask, setCurrentTask] = useState(props.member.task);
|
const [currentTask, setCurrentTask] = useState(props.member.task);
|
||||||
|
|
||||||
|
const contextMember = gang.members.find(member => member.name == props.member.name)
|
||||||
|
if (contextMember &&
|
||||||
|
contextMember.task != currentTask
|
||||||
|
) {
|
||||||
|
setCurrentTask(contextMember.task)
|
||||||
|
}
|
||||||
|
|
||||||
function onChange(event: SelectChangeEvent<string>): void {
|
function onChange(event: SelectChangeEvent<string>): void {
|
||||||
const task = event.target.value;
|
const task = event.target.value;
|
||||||
props.member.assignToTask(task);
|
props.member.assignToTask(task);
|
||||||
|
Loading…
Reference in New Issue
Block a user