Cosmetics (typescript)

This commit is contained in:
Eric van der Vlist 2023-06-13 11:03:02 +02:00
parent 787323bcac
commit 7caf088a7e
1 changed files with 3 additions and 10 deletions

View File

@ -32,7 +32,7 @@ export const getTagStatus = <TagStatus>(
) => {
const defaultStatus = {
highlighted: false,
};
} as TagStatus;
const activityDefinitions = definitions[selectedKey];
if (!activityDefinitions) {
return defaultStatus;
@ -47,23 +47,16 @@ export const getTagStatus = <TagStatus>(
if (!!highlightedDefinitions) {
const definition = highlightedDefinitions[tag];
if (!!definition) {
return { type, definition, highlighted: true };
return { type, definition, highlighted: true } as TagStatus;
}
}
for (const category of Object.keys(typeDefinitions)) {
if (category !== highlightedKey) {
const categoryDefinitions = typeDefinitions[category];
console.log({
caller: 'getTagStatus / looping over categories',
type,
typeDefinitions,
category,
categoryDefinitions,
});
const definition = categoryDefinitions[tag];
if (!!definition) {
return { type, definition, highlighted: false };
return { type, definition, highlighted: false } as TagStatus;
}
}
}