lint
This commit is contained in:
parent
eb1807351c
commit
c05381e6aa
26 changed files with 81 additions and 54 deletions
|
|
@ -81,7 +81,10 @@ export const maybeShowNotification = (
|
|||
|
||||
if (notification.seen) return
|
||||
if (!visibleTypes(notificationVisibility).includes(notification.type)) return
|
||||
if (notification.type === 'mention' && isMutedNotification(muteFilters, notification))
|
||||
if (
|
||||
notification.type === 'mention' &&
|
||||
isMutedNotification(muteFilters, notification)
|
||||
)
|
||||
return
|
||||
|
||||
const notificationObject = prepareNotificationObject(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,15 @@ export const muteFilterHits = (muteFilters, status) => {
|
|||
return muteFilters
|
||||
.toSorted((a, b) => b.order - a.order)
|
||||
.map((filter) => {
|
||||
const { hide, expires, name, value, type, enabled, caseSensitive = false } = filter
|
||||
const {
|
||||
hide,
|
||||
expires,
|
||||
name,
|
||||
value,
|
||||
type,
|
||||
enabled,
|
||||
caseSensitive = false,
|
||||
} = filter
|
||||
if (!enabled) return false
|
||||
if (value === '') return false
|
||||
if (expires !== null && expires < Date.now()) return false
|
||||
|
|
@ -18,9 +26,7 @@ export const muteFilterHits = (muteFilters, status) => {
|
|||
case 'word': {
|
||||
let match = false
|
||||
if (caseSensitive) {
|
||||
match =
|
||||
statusText.includes(value) ||
|
||||
statusSummary.includes(value)
|
||||
match = statusText.includes(value) || statusSummary.includes(value)
|
||||
} else {
|
||||
const lowercaseValue = value.toLowerCase()
|
||||
match =
|
||||
|
|
@ -56,7 +62,9 @@ export const muteFilterHits = (muteFilters, status) => {
|
|||
match =
|
||||
poster.toLowerCase().includes(lowercaseValue) ||
|
||||
replyToUser.toLowerCase().includes(lowercaseValue) ||
|
||||
mentions.some((mention) => mention.toLowerCase().includes(lowercaseValue))
|
||||
mentions.some((mention) =>
|
||||
mention.toLowerCase().includes(lowercaseValue),
|
||||
)
|
||||
}
|
||||
if (match) {
|
||||
return { hide, name }
|
||||
|
|
|
|||
|
|
@ -499,10 +499,7 @@ export const init = ({
|
|||
}),
|
||||
)
|
||||
const lastVariantRule = variantRules[variantRules.length - 1]
|
||||
const lastVariantSelector = ruleToSelector(
|
||||
lastVariantRule,
|
||||
true,
|
||||
)
|
||||
const lastVariantSelector = ruleToSelector(lastVariantRule, true)
|
||||
|
||||
if (lastVariantRule && lastVariantSelector !== selector) {
|
||||
inheritRule = lastVariantRule
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue