object assign

This commit is contained in:
Henry Jameson 2026-08-04 00:47:01 +03:00
commit ab6ac91072
2 changed files with 86 additions and 96 deletions

View file

@ -73,17 +73,15 @@ export default {
} }
}, },
logoBgStyle() { logoBgStyle() {
return Object.assign( const mask = this.enableMask
{ ? {}
margin: `${this.logoMargin} 0`, : {'background-color': this.enableMask ? '' : 'transparent'}
opacity: this.searchBarHidden ? 1 : 0,
}, return {
this.enableMask margin: `${this.logoMargin} 0`,
? {} opacity: this.searchBarHidden ? 1 : 0,
: { ...mask,
'background-color': this.enableMask ? '' : 'transparent', }
},
)
}, },
...mapState(useInstanceStore, ['privateMode']), ...mapState(useInstanceStore, ['privateMode']),
...mapState(useInstanceStore, { ...mapState(useInstanceStore, {

View file

@ -7,100 +7,92 @@ import {
} from 'src/services/entity_normalizer/entity_normalizer.service.js' } from 'src/services/entity_normalizer/entity_normalizer.service.js'
const makeMockUserMasto = (overrides = {}) => { const makeMockUserMasto = (overrides = {}) => {
return Object.assign( return {
{ acct: 'hj',
acct: 'hj', avatar:
avatar: 'https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png',
'https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png', avatar_static:
avatar_static: 'https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png',
'https://shigusegubu.club/media/1657b945-8d5b-4ce6-aafb-4c3fc5772120/8ce851029af84d55de9164e30cc7f46d60cbf12eee7e96c5c0d35d9038ddade1.png', bot: false,
bot: false, created_at: '2017-12-17T21:54:14.000Z',
created_at: '2017-12-17T21:54:14.000Z', display_name: 'whatever whatever whatever witch',
display_name: 'whatever whatever whatever witch', emojis: [],
emojis: [], fields: [],
fields: [], followers_count: 705,
followers_count: 705, following_count: 326,
following_count: 326, header:
header: 'https://shigusegubu.club/media/7ab024d9-2a8a-4fbc-9ce8-da06756ae2db/6aadefe4e264133bc377ab450e6b045b6f5458542a5c59e6c741f86107f0388b.png',
'https://shigusegubu.club/media/7ab024d9-2a8a-4fbc-9ce8-da06756ae2db/6aadefe4e264133bc377ab450e6b045b6f5458542a5c59e6c741f86107f0388b.png', header_static:
header_static: 'https://shigusegubu.club/media/7ab024d9-2a8a-4fbc-9ce8-da06756ae2db/6aadefe4e264133bc377ab450e6b045b6f5458542a5c59e6c741f86107f0388b.png',
'https://shigusegubu.club/media/7ab024d9-2a8a-4fbc-9ce8-da06756ae2db/6aadefe4e264133bc377ab450e6b045b6f5458542a5c59e6c741f86107f0388b.png', id: '1',
id: '1', locked: false,
locked: false, note: 'Volatile Internet Weirdo. Name pronounced as Hee Jay. JS and Java dark arts mage, Elixir trainee. I love sampo and lain. Matrix is <span><a data-user="1" href="https://shigusegubu.club/users/hj">@<span>hj</span></a></span>:matrix.heldscal.la Pronouns are whatever. Do not DM me unless it\'s truly private matter and you\'re instance\'s admin or you risk your DM to be reposted publicly.Wish i was Finnish girl.',
note: 'Volatile Internet Weirdo. Name pronounced as Hee Jay. JS and Java dark arts mage, Elixir trainee. I love sampo and lain. Matrix is <span><a data-user="1" href="https://shigusegubu.club/users/hj">@<span>hj</span></a></span>:matrix.heldscal.la Pronouns are whatever. Do not DM me unless it\'s truly private matter and you\'re instance\'s admin or you risk your DM to be reposted publicly.Wish i was Finnish girl.', pleroma: { confirmation_pending: false, tags: null },
pleroma: { confirmation_pending: false, tags: null }, source: { note: '', privacy: 'public', sensitive: false },
source: { note: '', privacy: 'public', sensitive: false }, statuses_count: 41775,
statuses_count: 41775, url: 'https://shigusegubu.club/users/hj',
url: 'https://shigusegubu.club/users/hj', username: 'hj',
username: 'hj', ...overrides,
}, }
overrides,
)
} }
const makeMockStatusMasto = (overrides = {}) => { const makeMockStatusMasto = (overrides = {}) => {
return Object.assign( return {
{ account: makeMockUserMasto(),
account: makeMockUserMasto(), application: { name: 'Web', website: null },
application: { name: 'Web', website: null }, content:
content: '<span><a data-user="14660" href="https://pleroma.soykaf.com/users/sampo">@<span>sampo</span></a></span> god i wish i was there',
'<span><a data-user="14660" href="https://pleroma.soykaf.com/users/sampo">@<span>sampo</span></a></span> god i wish i was there', created_at: '2019-01-17T16:29:23.000Z',
created_at: '2019-01-17T16:29:23.000Z', emojis: [],
emojis: [], favourited: false,
favourited: false, favourites_count: 1,
favourites_count: 1, id: '10423476',
id: '10423476', in_reply_to_account_id: '14660',
in_reply_to_account_id: '14660', in_reply_to_id: '10423197',
in_reply_to_id: '10423197', language: null,
language: null, media_attachments: [],
media_attachments: [], mentions: [
mentions: [ {
{ acct: 'sampo@pleroma.soykaf.com',
acct: 'sampo@pleroma.soykaf.com', id: '14660',
id: '14660', url: 'https://pleroma.soykaf.com/users/sampo',
url: 'https://pleroma.soykaf.com/users/sampo', username: 'sampo',
username: 'sampo',
},
],
muted: false,
reblog: null,
reblogged: false,
reblogs_count: 0,
replies_count: 0,
sensitive: false,
spoiler_text: '',
tags: [],
uri: 'https://shigusegubu.club/objects/16033fbb-97c0-4f0e-b834-7abb92fb8639',
url: 'https://shigusegubu.club/objects/16033fbb-97c0-4f0e-b834-7abb92fb8639',
visibility: 'public',
pleroma: {
local: true,
}, },
],
muted: false,
reblog: null,
reblogged: false,
reblogs_count: 0,
replies_count: 0,
sensitive: false,
spoiler_text: '',
tags: [],
uri: 'https://shigusegubu.club/objects/16033fbb-97c0-4f0e-b834-7abb92fb8639',
url: 'https://shigusegubu.club/objects/16033fbb-97c0-4f0e-b834-7abb92fb8639',
visibility: 'public',
pleroma: {
local: true,
}, },
overrides, ...overrides,
) }
} }
const makeMockEmojiMasto = (overrides = [{}]) => { const makeMockEmojiMasto = (overrides = [{}]) => {
return [ return [
Object.assign( {
{ shortcode: 'image',
shortcode: 'image', static_url: 'https://example.com/image.png',
static_url: 'https://example.com/image.png', url: 'https://example.com/image.png',
url: 'https://example.com/image.png', visible_in_picker: false,
visible_in_picker: false, ...overrides[0],
}, },
overrides[0], {
), shortcode: 'thinking',
Object.assign( static_url: 'https://example.com/think.png',
{ url: 'https://example.com/think.png',
shortcode: 'thinking', visible_in_picker: false,
static_url: 'https://example.com/think.png', ...overrides[1],
url: 'https://example.com/think.png', },
visible_in_picker: false,
},
overrides[1],
),
] ]
} }