(config: GameConfig, idx: number)
| 38 | }, []); |
| 39 | |
| 40 | const openEditor = async (config: GameConfig, idx: number) => { |
| 41 | // Populate config schemas |
| 42 | const pairs = config.middleware.map(m => { |
| 43 | const pair: MiddlewareVersionPair = { |
| 44 | id: m.middlewareId, |
| 45 | version: m.version |
| 46 | }; |
| 47 | return pair; |
| 48 | }); |
| 49 | const schemas = await window.Shared.back.request(BackIn.GET_MIDDLEWARE_CONFIG_SCHEMAS, pairs); |
| 50 | const copy: GameConfigEdit = { |
| 51 | ...deepCopy(config), |
| 52 | schemas, |
| 53 | }; |
| 54 | setConfigCopy(copy); |
| 55 | setCopyIdx(idx); |
| 56 | setEditorOpen(true); |
| 57 | }; |
| 58 | |
| 59 | const saveConfigCopy = async () => { |
| 60 | if (configCopy) { |
no test coverage detected