This commit is contained in:
Henry Jameson 2026-08-04 18:04:57 +03:00
commit 95bbe73832
19 changed files with 38 additions and 58 deletions

View file

@ -29,8 +29,8 @@ const Announcement = {
currentUser: (state) => state.users.currentUser,
}),
canEditAnnouncement() {
return (
this.currentUser?.privileges.has('announcements_manage_announcements')
return this.currentUser?.privileges.has(
'announcements_manage_announcements',
)
},
content() {

View file

@ -33,8 +33,8 @@ const AnnouncementsPage = {
return useAnnouncementsStore().announcements
},
canPostAnnouncement() {
return (
this.currentUser?.privileges.has('announcements_manage_announcements')
return this.currentUser?.privileges.has(
'announcements_manage_announcements',
)
},
},

View file

@ -42,9 +42,7 @@ const EditStatusModal = {
},
isFormVisible(val) {
if (val) {
this.$nextTick(
() => this.$el?.querySelector('textarea').focus(),
)
this.$nextTick(() => this.$el?.querySelector('textarea').focus())
}
},
},

View file

@ -75,9 +75,7 @@ const MentionLink = {
},
computed: {
user() {
return (
this.url && this.$store?.getters.findUserByUrl(this.url)
)
return this.url && this.$store?.getters.findUserByUrl(this.url)
},
isYou() {
// FIXME why user !== currentUser???

View file

@ -15,8 +15,7 @@ export const filterNavigation = (
if (!isFederating && set.has('federating')) return false
if (!currentUser && isPrivate && set.has('!private')) return false
if (!currentUser && !(anon || anonRoute)) return false
if ((!currentUser?.locked) && set.has('lockedUser'))
return false
if (!currentUser?.locked && set.has('lockedUser')) return false
if (!hasChats && set.has('chats')) return false
if (!hasAnnouncements && set.has('announcements')) return false
if (!supportsBubbleTimeline && set.has('supportsBubbleTimeline'))

View file

@ -39,13 +39,13 @@ export default {
return storePoll || {}
},
options() {
return (this.poll?.options) || []
return this.poll?.options || []
},
expiresAt() {
return (this.poll?.expires_at) || null
return this.poll?.expires_at || null
},
expired() {
return (this.poll?.expired) || false
return this.poll?.expired || false
},
expirationLabel() {
if (useMergedConfigStore().mergedConfig.useAbsoluteTimeFormat) {

View file

@ -129,9 +129,7 @@ const Popover = {
// Popover will be anchored around this element, trigger ref is the container, so
// its children are what are inside the slot. Expect only one v-slot:trigger.
const anchorEl =
this.anchorEl ||
(this.$refs.trigger?.children[0]) ||
this.$el
this.anchorEl || this.$refs.trigger?.children[0] || this.$el
// SVGs don't have offsetWidth/Height, use fallback
const anchorHeight = anchorEl.offsetHeight || anchorEl.clientHeight
const anchorWidth = anchorEl.offsetWidth || anchorEl.clientWidth
@ -246,12 +244,12 @@ const Popover = {
if (bottomBoundary + content.offsetHeight > yBounds.max) usingTop = true
if (topBoundary - content.offsetHeight < yBounds.min) usingTop = false
const yOffset = (this.offset?.y) || 0
const yOffset = this.offset?.y || 0
translateY = usingTop
? topBoundary - yOffset - content.offsetHeight
: bottomBoundary + yOffset
const xOffset = (this.offset?.x) || 0
const xOffset = this.offset?.x || 0
translateX = origin.x + horizOffset + xOffset
} else {
// Default to whatever user wished with placement prop
@ -267,12 +265,12 @@ const Popover = {
if (rightBoundary + content.offsetWidth > xBounds.max) usingLeft = true
if (leftBoundary - content.offsetWidth < xBounds.min) usingLeft = false
const xOffset = (this.offset?.x) || 0
const xOffset = this.offset?.x || 0
translateX = usingLeft
? leftBoundary - xOffset - content.offsetWidth
: rightBoundary + xOffset
const yOffset = (this.offset?.y) || 0
const yOffset = this.offset?.y || 0
translateY = origin.y + vertOffset + yOffset
}

View file

@ -40,9 +40,7 @@ const PostStatusModal = {
},
isFormVisible(val) {
if (val) {
this.$nextTick(
() => this.$el?.querySelector('textarea').focus(),
)
this.$nextTick(() => this.$el?.querySelector('textarea').focus())
}
},
},

View file

@ -258,10 +258,7 @@ export default {
currentMentions = null
}
} else if (Tag === 'span') {
if (
this.handleLinks &&
fullAttrs.class?.includes('h-card')
) {
if (this.handleLinks && fullAttrs.class?.includes('h-card')) {
return ['', children.map(processItem), '']
}
}
@ -299,7 +296,7 @@ export default {
const attrs = getAttrs(opener, () => true)
// should only be this
if (
(fullAttrs.class?.includes('hashtag')) || // Pleroma style
fullAttrs.class?.includes('hashtag') || // Pleroma style
fullAttrs.rel === 'tag' // Mastodon style
) {
return renderHashtag(attrs, children, encounteredTextReverse)

View file

@ -128,8 +128,7 @@ const Status = {
computed: {
showReasonMutedThread() {
return (
(this.status.thread_muted ||
(this.status.reblog?.thread_muted)) &&
(this.status.thread_muted || this.status.reblog?.thread_muted) &&
!this.inConversation
)
},

View file

@ -111,7 +111,11 @@ export default {
type="button"
role="tab"
>
<img src={props.image} alt={props['image-tooltip']} title={props['image-tooltip']} />
<img
src={props.image}
alt={props['image-tooltip']}
title={props['image-tooltip']}
/>
{props.label ? '' : props.label}
</button>
</div>

View file

@ -12,9 +12,7 @@ export const maybeShowChatNotification = (chat) => {
body: chat.lastMessage.content,
}
if (
chat.lastMessage.attachment?.type === 'image'
) {
if (chat.lastMessage.attachment?.type === 'image') {
opts.image = chat.lastMessage.attachment.preview_url
}

View file

@ -175,10 +175,7 @@ export const prepareNotificationObject = (notification, i18n) => {
}
// Shows first attached non-nsfw image, if any. Should add configuration for this somehow...
if (
!status.nsfw &&
status?.attachments?.[0]?.mimetype.startsWith('image/')
) {
if (!status.nsfw && status?.attachments?.[0]?.mimetype.startsWith('image/')) {
notifObj.image = status.attachments[0].url
}

View file

@ -1,7 +1,9 @@
/* global process */
function urlBase64ToUint8Array(base64String) {
const padding = '='.repeat((4 - (base64String.length % 4)) % 4)
const base64 = (base64String + padding).replaceAll('-', '+').replace(/_/g, '/')
const base64 = (base64String + padding)
.replaceAll('-', '+')
.replace(/_/g, '/')
const rawData = window.atob(base64)
return Uint8Array.from([...rawData].map((char) => char.codePointAt(0)))

View file

@ -244,10 +244,7 @@ export const OPACITIES = Object.entries(SLOT_INHERITANCE).reduce((acc, [k]) => {
...acc,
[opacity]: {
defaultValue: DEFAULT_OPACITY[opacity] || 1,
affectedSlots: [
...((acc[opacity]?.affectedSlots) || []),
k,
],
affectedSlots: [...(acc[opacity]?.affectedSlots || []), k],
},
}
} else {

View file

@ -69,8 +69,7 @@ export const useChatsStore = defineStore('chats', {
if (chat) {
const isNewMessage =
(chat.lastMessage?.id) !==
(updatedChat.lastMessage?.id)
chat.lastMessage?.id !== updatedChat.lastMessage?.id
chat.lastMessage = updatedChat.lastMessage
chat.unread = updatedChat.unread
chat.updated_at = updatedChat.updated_at

View file

@ -577,7 +577,8 @@ export const useInterfaceStore = defineStore('interface', {
return { name: x.variant, ...cleanDirectives }
})
.forEach((palette) => {
const key = 'style.' + palette.name.toLowerCase().replaceAll(' ', '_')
const key =
'style.' + palette.name.toLowerCase().replaceAll(' ', '_')
if (!firstStylePaletteName) firstStylePaletteName = key
palettesIndex[key] = () => Promise.resolve(palette)
})

View file

@ -195,9 +195,10 @@ export const _getRecentData = (cache, live, isTest) => {
}
export const _getAllFlags = (recent, stale) => {
const recentStorage = toRaw(recent?.flagStorage)
const staleStorage = toRaw(stale?.flagStorage)
return Array.from(
recentStorage = toRaw(recent?.flagStorage)
staleStorage = toRaw(stale?.flagStorage)
new Set([
...Object.keys(recentStorage || {}),
...Object.keys(staleStorage || {}),

View file

@ -363,10 +363,7 @@ describe('RichContent', () => {
})
expect(
wrapper
.html()
.replaceAll('\n', '')
.replaceAll('<!--.*?-->', ''),
wrapper.html().replaceAll('\n', '').replaceAll('<!--.*?-->', ''),
).to.eql(compwrap(expected))
})
@ -436,10 +433,7 @@ describe('RichContent', () => {
})
expect(
wrapper
.html()
.replaceAll('\n', '')
.replaceAll('<!--.*?-->', ''),
wrapper.html().replaceAll('\n', '').replaceAll('<!--.*?-->', ''),
).to.eql(compwrap(expected))
})