Cosmetics (typescript)
This commit is contained in:
parent
787323bcac
commit
7caf088a7e
|
@ -32,7 +32,7 @@ export const getTagStatus = <TagStatus>(
|
||||||
) => {
|
) => {
|
||||||
const defaultStatus = {
|
const defaultStatus = {
|
||||||
highlighted: false,
|
highlighted: false,
|
||||||
};
|
} as TagStatus;
|
||||||
const activityDefinitions = definitions[selectedKey];
|
const activityDefinitions = definitions[selectedKey];
|
||||||
if (!activityDefinitions) {
|
if (!activityDefinitions) {
|
||||||
return defaultStatus;
|
return defaultStatus;
|
||||||
|
@ -47,23 +47,16 @@ export const getTagStatus = <TagStatus>(
|
||||||
if (!!highlightedDefinitions) {
|
if (!!highlightedDefinitions) {
|
||||||
const definition = highlightedDefinitions[tag];
|
const definition = highlightedDefinitions[tag];
|
||||||
if (!!definition) {
|
if (!!definition) {
|
||||||
return { type, definition, highlighted: true };
|
return { type, definition, highlighted: true } as TagStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const category of Object.keys(typeDefinitions)) {
|
for (const category of Object.keys(typeDefinitions)) {
|
||||||
if (category !== highlightedKey) {
|
if (category !== highlightedKey) {
|
||||||
const categoryDefinitions = typeDefinitions[category];
|
const categoryDefinitions = typeDefinitions[category];
|
||||||
console.log({
|
|
||||||
caller: 'getTagStatus / looping over categories',
|
|
||||||
type,
|
|
||||||
typeDefinitions,
|
|
||||||
category,
|
|
||||||
categoryDefinitions,
|
|
||||||
});
|
|
||||||
const definition = categoryDefinitions[tag];
|
const definition = categoryDefinitions[tag];
|
||||||
if (!!definition) {
|
if (!!definition) {
|
||||||
return { type, definition, highlighted: false };
|
return { type, definition, highlighted: false } as TagStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue