Compare commits
No commits in common. "47a6777284a2896ce148d61cbb7048b9cc9a26d0" and "42f51ff3155995ecb4968e8150eb3f356cf97732" have entirely different histories.
47a6777284
...
42f51ff315
6 changed files with 14 additions and 22 deletions
|
|
@ -66,7 +66,7 @@ const FilteringTab = {
|
|||
let valid = true
|
||||
try {
|
||||
new RegExp(value)
|
||||
} catch {
|
||||
} catch (e) {
|
||||
valid = false
|
||||
console.error('Invalid RegExp: ' + value)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
.muteFilterContainer {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--roundness);
|
||||
|
||||
height: 33vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
|
@ -11,6 +12,7 @@
|
|||
border-radius: var(--roundness);
|
||||
margin: 0.5em;
|
||||
padding: 0.5em;
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: fit-content() 1fr fit-content();
|
||||
align-items: baseline;
|
||||
|
|
@ -22,8 +24,7 @@
|
|||
grid-row: 1;
|
||||
}
|
||||
|
||||
.alert,
|
||||
.button-default {
|
||||
.alert, .button-default {
|
||||
display: inline-block;
|
||||
line-height: 2;
|
||||
padding: 0 0.5em;
|
||||
|
|
@ -32,6 +33,7 @@
|
|||
.filter-enabled {
|
||||
grid-column: 3;
|
||||
grid-row: 1;
|
||||
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
<template>
|
||||
<div
|
||||
:label="$t('settings.filtering')"
|
||||
class="filtering-tab"
|
||||
>
|
||||
<div :label="$t('settings.filtering')" class="filtering-tab">
|
||||
<div class="setting-item">
|
||||
<h2>{{ $t('settings.posts') }}</h2>
|
||||
<ul class="setting-list">
|
||||
|
|
@ -77,7 +74,7 @@
|
|||
class="mute-filter"
|
||||
:style="{ order: filter[1].order }"
|
||||
v-for="filter in muteFilters"
|
||||
:key="filter[0]"
|
||||
key="filter[0]"
|
||||
>
|
||||
<div class="filter-name">
|
||||
<label
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import generateProfileLink from 'src/services/user_profile_link_generator/user_p
|
|||
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
||||
import { muteFilterHits } from '../../services/status_parser/status_parser.js'
|
||||
import { unescape, uniqBy } from 'lodash'
|
||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import {
|
||||
|
|
@ -220,10 +219,7 @@ const Status = {
|
|||
return !!this.currentUser
|
||||
},
|
||||
muteFilterHits () {
|
||||
return muteFilterHits(
|
||||
Object.values(useServerSideStorageStore().prefsStorage.simple.muteFilters),
|
||||
this.status
|
||||
)
|
||||
return muteFilterHits(this.status)
|
||||
},
|
||||
botStatus () {
|
||||
return this.status.user.actor_type === 'Service'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import apiService from '../services/api/api.service.js'
|
||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||
|
||||
import {
|
||||
isStatusNotification,
|
||||
|
|
@ -113,11 +112,7 @@ export const notifications = {
|
|||
commit('updateNotificationsMinMaxId', notification.id)
|
||||
commit('addNewNotifications', { notifications: [notification] })
|
||||
|
||||
maybeShowNotification(
|
||||
store,
|
||||
Object.values(useServerSideStorageStore().prefsStorage.simple.muteFilters),
|
||||
notification
|
||||
)
|
||||
maybeShowNotification(store, notification)
|
||||
} else if (notification.seen) {
|
||||
state.idStore[notification.id].seen = true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
export const muteFilterHits = (muteFilters, status) => {
|
||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||
|
||||
export const muteFilterHits = (status) => {
|
||||
const statusText = status.text.toLowerCase()
|
||||
const statusSummary = status.summary.toLowerCase()
|
||||
|
||||
const muteFilters = Object.values(useServerSideStorageStore().prefsStorage.simple.muteFilters)
|
||||
|
||||
return muteFilters.toSorted((a,b) => b.order - a.order).map(filter => {
|
||||
const { hide, expires, name, value, type, enabled} = filter
|
||||
if (!enabled) return false
|
||||
|
|
@ -11,7 +15,6 @@ export const muteFilterHits = (muteFilters, status) => {
|
|||
if (statusText.includes(value) || statusSummary.includes(value)) {
|
||||
return { hide, name }
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'regexp': {
|
||||
try {
|
||||
|
|
@ -19,7 +22,6 @@ export const muteFilterHits = (muteFilters, status) => {
|
|||
if (re.test(statusText) || re.test(statusSummary)) {
|
||||
return { hide, name }
|
||||
}
|
||||
return false
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue