diff --git a/src/lib/api/adapters/resources/__tests__/search.resource.test.ts b/src/lib/api/adapters/resources/__tests__/search.resource.test.ts index 332bbfa5..f320f8fd 100644 --- a/src/lib/api/adapters/resources/__tests__/search.resource.test.ts +++ b/src/lib/api/adapters/resources/__tests__/search.resource.test.ts @@ -176,14 +176,12 @@ describe('SearchResource', () => { // Set some mock data resource.weapons = { loading: false, - data: { results: [] }, - error: undefined + data: { results: [] } } resource.characters = { loading: false, - data: { results: [] }, - error: undefined + data: { results: [] } } // Clear weapons only diff --git a/src/lib/features/description/openDescriptionSidebar.svelte.ts b/src/lib/features/description/openDescriptionSidebar.svelte.ts index 58d2a89e..2ba0fd00 100644 --- a/src/lib/features/description/openDescriptionSidebar.svelte.ts +++ b/src/lib/features/description/openDescriptionSidebar.svelte.ts @@ -12,7 +12,7 @@ export function openDescriptionSidebar(options: DescriptionSidebarOptions) { const { title, description, canEdit = false, onEdit } = options // Open the sidebar with the party title as the header - sidebar.openWithComponent(title, DescriptionSidebar, { + sidebar.openWithComponent(title ?? '', DescriptionSidebar, { title, description, canEdit, diff --git a/src/lib/utils/jobUtils.ts b/src/lib/utils/jobUtils.ts index 0d285f7a..6c3209a8 100644 --- a/src/lib/utils/jobUtils.ts +++ b/src/lib/utils/jobUtils.ts @@ -190,11 +190,13 @@ export function formatJobProficiency(proficiency: [number, number]): string[] { } const result: string[] = [] - if (proficiency[0] && weaponTypes[proficiency[0]]) { - result.push(weaponTypes[proficiency[0]]) + const type1 = proficiency[0] ? weaponTypes[proficiency[0]] : undefined + if (type1) { + result.push(type1) } - if (proficiency[1] && weaponTypes[proficiency[1]]) { - result.push(weaponTypes[proficiency[1]]) + const type2 = proficiency[1] ? weaponTypes[proficiency[1]] : undefined + if (type2) { + result.push(type2) } return result