diff --git a/frontend/src/stores/calls.test.ts b/frontend/src/stores/calls.test.ts index e8df8f4..8fc9c80 100644 --- a/frontend/src/stores/calls.test.ts +++ b/frontend/src/stores/calls.test.ts @@ -166,4 +166,33 @@ describe('calls store', () => { expect(nuiCall).toHaveBeenNthCalledWith(2, 'contacts:list') expect(calls.contacts[0]?.favorite).toBe(true) }) + + it('keeps configured company branding on system contacts', async () => { + vi.mocked(nuiCall).mockResolvedValueOnce({ + success: true, + data: [ + { + avatar_url: + 'https://picsum.photos/seed/companies-police-logo/180/180', + companyId: 'police', + id: 'company:police', + name: 'Los Santos Police Department', + organization: 'Los Santos Police Department', + phone_number: '911', + readonly: true, + source: 'company', + }, + ], + }) + const calls = useCallsStore() + + await calls.loadContacts() + + expect(calls.contacts[0]).toMatchObject({ + avatar_url: + 'https://picsum.photos/seed/companies-police-logo/180/180', + organization: 'Los Santos Police Department', + source: 'company', + }) + }) }) diff --git a/frontend/src/types/phone.ts b/frontend/src/types/phone.ts index bf9016a..3c88d55 100644 --- a/frontend/src/types/phone.ts +++ b/frontend/src/types/phone.ts @@ -17,7 +17,6 @@ export type PhoneContact = { created_at?: string favorite?: boolean | number id: string - icon?: string name: string notes?: string | null organization?: string | null diff --git a/frontend/src/views/apps/PhoneApp.vue b/frontend/src/views/apps/PhoneApp.vue index a3a4fc8..9d74b98 100644 --- a/frontend/src/views/apps/PhoneApp.vue +++ b/frontend/src/views/apps/PhoneApp.vue @@ -280,7 +280,7 @@ function openContact(contact?: PhoneContact, number = ''): void { contactNotes.value = contact?.notes ?? '' contactNumber.value = contact?.phone_number ?? number contactAvatarMediaId.value = contact?.avatar_media_id ?? null - contactAvatarUrl.value = contact?.avatar_url ?? contact?.icon ?? '' + contactAvatarUrl.value = contact?.avatar_url ?? '' error.value = '' editorOpened.value = true } @@ -971,8 +971,8 @@ onBeforeUnmount(() => {