mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-24 00:23:49 +01:00
gang member current task disconnect fix
* Added check to manually update interal state of dropdown on change of a members task via api
This commit is contained in:
parent
9294ff3e9e
commit
f2ba3e0ac7
@ -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