diff --git a/src/stores/statuses.js b/src/stores/statuses.js index 890dd4002..80bd2e7d7 100644 --- a/src/stores/statuses.js +++ b/src/stores/statuses.js @@ -192,7 +192,11 @@ export const useStatusesStore = defineStore('statuses', { credentials: useOAuthStore().token, }).then(({ data, timestamp }) => { data.forEach((reaction) => { - const users = useUsersStore().addNewUsers({ timestamp, data: reaction.accounts }) + const users = useUsersStore().addNewUsers({ + timestamp, + data: reaction.accounts, + }) + reaction.accounts = users }) this.addEmojiReactionsBy(id, data) }) diff --git a/test/unit/specs/stores/statuses.spec.js b/test/unit/specs/stores/statuses.spec.js index 31bf517d2..f4064ec9d 100644 --- a/test/unit/specs/stores/statuses.spec.js +++ b/test/unit/specs/stores/statuses.spec.js @@ -290,7 +290,10 @@ describe('Statuses store', () => { 'EmojiReactions', [ { - accounts: [mockMastoAPIUser({ id: 'u1' }), mockMastoAPIUser({ id: 'u2' })], + accounts: [ + mockMastoAPIUser({ id: 'u1' }), + mockMastoAPIUser({ id: 'u2' }), + ], count: 1, me: false, name: 'cofe', @@ -298,8 +301,14 @@ describe('Statuses store', () => { }, ], ], - ['Favs', [mockMastoAPIUser({ id: 'u1' }), mockMastoAPIUser({ id: 'u2' })]], - ['Repeats', [mockMastoAPIUser({ id: 'u1' }), mockMastoAPIUser({ id: 'u2' })]], + [ + 'Favs', + [mockMastoAPIUser({ id: 'u1' }), mockMastoAPIUser({ id: 'u2' })], + ], + [ + 'Repeats', + [mockMastoAPIUser({ id: 'u1' }), mockMastoAPIUser({ id: 'u2' })], + ], ])('fetch%s', async (group, mockedResponse) => { const mockFetch = vi.fn() mockFetch.mockResolvedValueOnce(