mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-09 17:25:38 +00:00
fix(Map): First prototype of windows
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ContextStoreDataUpdate, useContextStore } from '@/hooks/Mapper/utils';
|
||||
import { createContext, Dispatch, ForwardedRef, forwardRef, SetStateAction, useContext } from 'react';
|
||||
import { createContext, Dispatch, ForwardedRef, forwardRef, SetStateAction, useContext, useEffect } from 'react';
|
||||
import { MapUnionTypes, OutCommandHandler, SolarSystemConnection } from '@/hooks/Mapper/types';
|
||||
import { useMapRootHandlers } from '@/hooks/Mapper/mapRootProvider/hooks';
|
||||
import { WithChildren } from '@/hooks/Mapper/types/common.ts';
|
||||
@@ -99,6 +99,24 @@ export const MapRootProvider = ({ children, fwdRef, outCommand }: MapRootProvide
|
||||
},
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
let foundNew = false;
|
||||
const newVals = Object.keys(STORED_INTERFACE_DEFAULT_VALUES).reduce((acc, x) => {
|
||||
if (Object.keys(acc).includes(x)) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
foundNew = true;
|
||||
|
||||
// @ts-ignore
|
||||
return { ...acc, [x]: STORED_INTERFACE_DEFAULT_VALUES[x] };
|
||||
}, interfaceSettings);
|
||||
|
||||
if (foundNew) {
|
||||
setInterfaceSettings(newVals);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<MapRootContext.Provider
|
||||
value={{
|
||||
|
||||
Reference in New Issue
Block a user