Updated WorkerScript-related code for the workerScripts array->map change

This commit is contained in:
danielyxie
2019-06-19 01:51:25 -07:00
committed by danielyxie
parent 821725cf4d
commit 4cc6437408
6 changed files with 83 additions and 78 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ interface IServerToScriptsMap {
}
type IProps = {
workerScripts: WorkerScript[];
workerScripts: Map<number, WorkerScript>;
};
type IState = {
@@ -61,7 +61,7 @@ export class ServerAccordions extends React.Component<IProps, IState> {
updateServerToScriptsMap(): void {
const map: IServerToScriptsMap = {};
for (const ws of this.props.workerScripts) {
for (const ws of this.props.workerScripts.values()) {
const server = getServer(ws.serverIp);
if (server == null) {
console.warn(`WorkerScript has invalid IP address: ${ws.serverIp}`);