refactor(typesContext.tsx): reverse the order of keys in the types object to avoid overlap with tool world
The keys in the types object were reversed to avoid overlap with the tool world. This was done by modifying the reduce function in the TypesProvider component.
This commit is contained in:
parent
20b19967da
commit
e1e5fb14c9
1 changed files with 2 additions and 1 deletions
|
|
@ -51,7 +51,8 @@ export function TypesProvider({ children }: { children: ReactNode }) {
|
|||
);
|
||||
// Set the types by reducing over the keys of the result data and updating the accumulator.
|
||||
setTypes(
|
||||
Object.keys(result.data).reduce((acc, curr) => {
|
||||
// Reverse the keys so the tool world does not overlap
|
||||
Object.keys(result.data).reverse().reduce((acc, curr) => {
|
||||
Object.keys(result.data[curr]).forEach((c: keyof APIKindType) => {
|
||||
acc[c] = curr;
|
||||
// Add the base classes to the accumulator as well.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue