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