This commit is contained in:
Henry Jameson 2026-08-28 16:18:56 +03:00
commit b124d2b8ea
2 changed files with 17 additions and 4 deletions

View file

@ -192,7 +192,11 @@ export const useStatusesStore = defineStore('statuses', {
credentials: useOAuthStore().token, credentials: useOAuthStore().token,
}).then(({ data, timestamp }) => { }).then(({ data, timestamp }) => {
data.forEach((reaction) => { 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) this.addEmojiReactionsBy(id, data)
}) })

View file

@ -290,7 +290,10 @@ describe('Statuses store', () => {
'EmojiReactions', 'EmojiReactions',
[ [
{ {
accounts: [mockMastoAPIUser({ id: 'u1' }), mockMastoAPIUser({ id: 'u2' })], accounts: [
mockMastoAPIUser({ id: 'u1' }),
mockMastoAPIUser({ id: 'u2' }),
],
count: 1, count: 1,
me: false, me: false,
name: 'cofe', 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) => { ])('fetch%s', async (group, mockedResponse) => {
const mockFetch = vi.fn() const mockFetch = vi.fn()
mockFetch.mockResolvedValueOnce( mockFetch.mockResolvedValueOnce(