chore: bump data and dogma-engine to latest (#154)

This commit is contained in:
Patric Stout
2024-08-06 15:18:36 +02:00
committed by GitHub
parent 6b70fe0888
commit 5e0a8f73cb
3 changed files with 20 additions and 4 deletions

View File

@@ -68,7 +68,7 @@
},
"peerDependencies": {
"@eveshipfit/data": "^10",
"@eveshipfit/dogma-engine": "^6",
"@eveshipfit/dogma-engine": "^7",
"react": "^18",
"react-dom": "^18"
},

View File

@@ -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(() => {

View File

@@ -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 {