more optional chaining + lint

This commit is contained in:
Henry Jameson 2026-08-04 16:02:26 +03:00
commit 0637d2f7e0
3 changed files with 4 additions and 7 deletions

View file

@ -320,7 +320,7 @@ const Status = {
// Muted user // Muted user
relationship.muting || relationship.muting ||
// Muted user of a reprööt // Muted user of a reprööt
(relationshipReblog?.muting) relationshipReblog?.muting
) )
}, },
shouldNotMute() { shouldNotMute() {
@ -333,7 +333,7 @@ const Status = {
// Don't mute user's posts on user timeline (except reblogs) // Don't mute user's posts on user timeline (except reblogs)
((!reblog && status.user.id === this.profileUserId) || ((!reblog && status.user.id === this.profileUserId) ||
// Same as above but also allow self-reblogs // Same as above but also allow self-reblogs
(reblog?.user.id === this.profileUserId))) || reblog?.user.id === this.profileUserId)) ||
// Don't mute statuses in muted conversation when said conversation is opened // Don't mute statuses in muted conversation when said conversation is opened
(this.inConversation && status.thread_muted)) && (this.inConversation && status.thread_muted)) &&
// No excuses if post has muted words // No excuses if post has muted words

View file

@ -138,7 +138,7 @@ export default {
const existingReaction = this.status.emoji_reactions.find( const existingReaction = this.status.emoji_reactions.find(
(r) => r.name === emoji, (r) => r.name === emoji,
) )
if (existingReaction && existingReaction.me) { if (existingReaction?.me) {
this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji }) this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji })
} else { } else {
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji }) this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })

View file

@ -229,10 +229,7 @@ export const getLayerSlot = (
*/ */
export const SLOT_ORDERED = topoSort( export const SLOT_ORDERED = topoSort(
Object.entries(SLOT_INHERITANCE) Object.entries(SLOT_INHERITANCE)
.sort( .sort(([, aV], [, bV]) => (aV?.priority || 0) - (bV?.priority || 0))
([, aV], [, bV]) =>
((aV?.priority) || 0) - ((bV && bV.priority) || 0),
)
.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {}), .reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {}),
) )