fix(Map): Fix system revert issues

This commit is contained in:
Dmitry Popov
2025-01-14 21:47:05 +01:00
parent 8a3d920c31
commit e784a3f850
2 changed files with 15 additions and 5 deletions

View File

@@ -33,7 +33,17 @@ function sortedLabels(labels: string[]) {
export function useSolarSystemNode(props: NodeProps<MapSolarSystemType>) { export function useSolarSystemNode(props: NodeProps<MapSolarSystemType>) {
const { id, data, selected } = props; const { id, data, selected } = props;
const { system_static_info, system_signatures, locked, name, tag, status, labels, temporary_name } = data; const {
system_static_info,
system_signatures,
locked,
name,
tag,
status,
labels,
temporary_name,
linked_sig_eve_id: linkedSigEveId = '',
} = data;
const { const {
system_class, system_class,
@@ -71,7 +81,6 @@ export function useSolarSystemNode(props: NodeProps<MapSolarSystemType>) {
visibleNodes, visibleNodes,
showKSpaceBG, showKSpaceBG,
isThickConnections, isThickConnections,
linkedSigEveId,
}, },
outCommand, outCommand,
} = useMapState(); } = useMapState();
@@ -133,11 +142,11 @@ export function useSolarSystemNode(props: NodeProps<MapSolarSystemType>) {
} }
if (isShowLinkedSigIdTempName && linkedSigPrefix) { if (isShowLinkedSigIdTempName && linkedSigPrefix) {
return temporary_name ? `${linkedSigPrefix}${temporary_name}` : linkedSigPrefix; return temporary_name ? `${linkedSigPrefix}${temporary_name}` : `${linkedSigPrefix}${solar_system_name}`;
} }
return temporary_name; return temporary_name;
}, [isShowLinkedSigIdTempName, isTempSystemNameEnabled, linkedSigPrefix, temporary_name]); }, [isShowLinkedSigIdTempName, isTempSystemNameEnabled, linkedSigPrefix, solar_system_name, temporary_name]);
const systemName = useMemo(() => { const systemName = useMemo(() => {
if (isTempSystemNameEnabled && temporaryName) { if (isTempSystemNameEnabled && temporaryName) {
@@ -146,7 +155,7 @@ export function useSolarSystemNode(props: NodeProps<MapSolarSystemType>) {
return solar_system_name; return solar_system_name;
}, [isTempSystemNameEnabled, solar_system_name, temporaryName]); }, [isTempSystemNameEnabled, solar_system_name, temporaryName]);
const customName = (isTempSystemNameEnabled && temporaryName && name) || (solar_system_name !== name && name); const customName = (isTempSystemNameEnabled && temporary_name && name) || (solar_system_name !== name && name);
const [unsplashedLeft, unsplashedRight] = useMemo(() => { const [unsplashedLeft, unsplashedRight] = useMemo(() => {
if (!isShowUnsplashedSignatures) { if (!isShowUnsplashedSignatures) {

View File

@@ -117,6 +117,7 @@ export type SolarSystemRawType = {
status: number; status: number;
name: string | null; name: string | null;
temporary_name: string | null; temporary_name: string | null;
linked_sig_eve_id: string | null;
system_static_info: SolarSystemStaticInfoRaw; system_static_info: SolarSystemStaticInfoRaw;
system_signatures: SystemSignature[]; system_signatures: SystemSignature[];