mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 18:56:01 +00:00
fix(Core): Fix adding systems on splash (#71)
* fix(Core): Fix adding systems on splash
This commit is contained in:
@@ -12,6 +12,7 @@ export const useMapAddSystems = () => {
|
|||||||
return useCallback((systems: CommandAddSystems) => {
|
return useCallback((systems: CommandAddSystems) => {
|
||||||
const { rf } = ref.current;
|
const { rf } = ref.current;
|
||||||
const nodes = rf.getNodes();
|
const nodes = rf.getNodes();
|
||||||
|
|
||||||
const prepared: Node[] = systems.filter(x => !nodes.some(y => x.id === y.id)).map(convertSystem2Node);
|
const prepared: Node[] = systems.filter(x => !nodes.some(y => x.id === y.id)).map(convertSystem2Node);
|
||||||
rf.addNodes(prepared);
|
rf.addNodes(prepared);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -112,13 +112,17 @@ export const useMapHandlers = (ref: ForwardedRef<MapHandlers>, onSelectionChange
|
|||||||
connections: [],
|
connections: [],
|
||||||
});
|
});
|
||||||
selectSystem(systemId as CommandSelectSystem);
|
selectSystem(systemId as CommandSelectSystem);
|
||||||
}, 100);
|
}, 500);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Commands.routes:
|
case Commands.routes:
|
||||||
// do nothing here
|
// do nothing here
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Commands.signaturesUpdated:
|
||||||
|
// do nothing here
|
||||||
|
break;
|
||||||
|
|
||||||
case Commands.linkSignatureToSystem:
|
case Commands.linkSignatureToSystem:
|
||||||
// do nothing here
|
// do nothing here
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -87,6 +87,14 @@ export const useMapRootHandlers = (ref: ForwardedRef<MapHandlers>) => {
|
|||||||
mapRoutes(data as CommandRoutes);
|
mapRoutes(data as CommandRoutes);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Commands.signaturesUpdated: // USED
|
||||||
|
// do nothing here
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Commands.linkSignatureToSystem: // USED
|
||||||
|
// do nothing here
|
||||||
|
break;
|
||||||
|
|
||||||
case Commands.centerSystem: // USED
|
case Commands.centerSystem: // USED
|
||||||
// do nothing here
|
// do nothing here
|
||||||
break;
|
break;
|
||||||
@@ -95,22 +103,10 @@ export const useMapRootHandlers = (ref: ForwardedRef<MapHandlers>) => {
|
|||||||
// do nothing here
|
// do nothing here
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// case Commands.linkSignatureToSystem:
|
|
||||||
// // TODO command data type lost
|
|
||||||
// // @ts-ignore
|
|
||||||
// emitMapEvent({ name: Commands.linkSignatureToSystem, data });
|
|
||||||
// break;
|
|
||||||
|
|
||||||
case Commands.killsUpdated:
|
case Commands.killsUpdated:
|
||||||
// do nothing here
|
// do nothing here
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// case Commands.signaturesUpdated:
|
|
||||||
// // TODO command data type lost
|
|
||||||
// // @ts-ignore
|
|
||||||
// emitMapEvent({ name: Commands.signaturesUpdated, data });
|
|
||||||
// break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.warn(`JOipP Interface handlers: Unknown command: ${type}`, data);
|
console.warn(`JOipP Interface handlers: Unknown command: ${type}`, data);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
"@shopify/draggable": "^1.1.3",
|
"@shopify/draggable": "^1.1.3",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"daisyui": "^4.11.1",
|
"daisyui": "^4.11.1",
|
||||||
|
"jotai": "^2.10.2",
|
||||||
"live_select": "file:../deps/live_select",
|
"live_select": "file:../deps/live_select",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
"lodash.isequal": "^4.5.0",
|
"lodash.isequal": "^4.5.0",
|
||||||
|
|||||||
@@ -2598,6 +2598,11 @@ jiti@^1.19.1:
|
|||||||
resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz"
|
resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz"
|
||||||
integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==
|
integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==
|
||||||
|
|
||||||
|
jotai@^2.10.2:
|
||||||
|
version "2.10.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/jotai/-/jotai-2.10.2.tgz#c5fe5419e0526c262d401d6033f7a2c0049ce1b4"
|
||||||
|
integrity sha512-DqsBTlRglIBviuJLfK6JxZzpd6vKfbuJ4IqRCz70RFEDeZf46Fcteb/FXxNr1UnoxR5oUy3oq7IE8BrEq0G5DQ==
|
||||||
|
|
||||||
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
|
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
|
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
|
||||||
|
|||||||
@@ -1897,6 +1897,7 @@ defmodule WandererApp.Map.Server.Impl do
|
|||||||
)
|
)
|
||||||
|
|
||||||
WandererApp.Map.add_system(map_id, updated_system)
|
WandererApp.Map.add_system(map_id, updated_system)
|
||||||
|
|
||||||
broadcast!(map_id, :add_system, updated_system)
|
broadcast!(map_id, :add_system, updated_system)
|
||||||
:ok
|
:ok
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user