mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-19 04:49:37 +02:00
Refactor adventure category handling: update type definitions, enhance category management in UI components, and implement user-specific category deletion logic in the backend
This commit is contained in:
parent
736ede2417
commit
8e5a20ec62
12 changed files with 324 additions and 93 deletions
|
@ -292,3 +292,16 @@ export function getRandomBackground() {
|
|||
const randomIndex = Math.floor(Math.random() * randomBackgrounds.backgrounds.length);
|
||||
return randomBackgrounds.backgrounds[randomIndex] as Background;
|
||||
}
|
||||
|
||||
export function findFirstValue(obj: any): any {
|
||||
for (const key in obj) {
|
||||
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
||||
const value = findFirstValue(obj[key]);
|
||||
if (value !== undefined) {
|
||||
return value;
|
||||
}
|
||||
} else {
|
||||
return obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue