chore: bump data and dogma-engine to latest (#154)
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@eveshipfit/data": "^10",
|
||||
"@eveshipfit/dogma-engine": "^6",
|
||||
"@eveshipfit/dogma-engine": "^7",
|
||||
"react": "^18",
|
||||
"react-dom": "^18"
|
||||
},
|
||||
|
||||
@@ -30,7 +30,9 @@ declare global {
|
||||
get_dogma_attribute?: unknown;
|
||||
get_dogma_effects?: unknown;
|
||||
get_dogma_effect?: unknown;
|
||||
get_type_id?: unknown;
|
||||
get_type?: unknown;
|
||||
type_name_to_id?: unknown;
|
||||
attribute_name_to_id?: unknown;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,9 +90,23 @@ export const DogmaEngineProvider = (props: DogmaEngineProps) => {
|
||||
window.get_dogma_effect = (effect_id: number): DogmaEffect | undefined => {
|
||||
return eveData.dogmaEffects[effect_id];
|
||||
};
|
||||
window.get_type_id = (type_id: number): Type | undefined => {
|
||||
window.get_type = (type_id: number): Type | undefined => {
|
||||
return eveData.types[type_id];
|
||||
};
|
||||
window.type_name_to_id = (name: string): number | undefined => {
|
||||
for (const [id, type] of Object.entries(eveData.types)) {
|
||||
if (type.name === name) {
|
||||
return parseInt(id);
|
||||
}
|
||||
}
|
||||
};
|
||||
window.attribute_name_to_id = (name: string): number | undefined => {
|
||||
for (const [id, attribute] of Object.entries(eveData.dogmaAttributes)) {
|
||||
if (attribute.name === name) {
|
||||
return parseInt(id);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const contextValue = React.useMemo(() => {
|
||||
|
||||
@@ -38,7 +38,7 @@ export const useStatistics = () => {
|
||||
|
||||
export const useCurrentStatistics = () => {
|
||||
const statistics = React.useContext(StatisticsContext);
|
||||
return statistics === null ? null : statistics.current ?? statistics.statistics;
|
||||
return statistics === null ? null : (statistics.current ?? statistics.statistics);
|
||||
};
|
||||
|
||||
interface StatisticsProps {
|
||||
|
||||
Reference in New Issue
Block a user