mirror of
https://github.com/tooot-app/app
synced 2025-02-01 11:06:56 +01:00
Fix bugs
This commit is contained in:
parent
9d26053cce
commit
c72f26c260
@ -44,24 +44,28 @@ export const shouldFilter = ({
|
||||
getInstanceAccount(store.getState())?.id === status.account.id
|
||||
|
||||
let shouldFilter = false
|
||||
if (queryKey && !ownAccount) {
|
||||
if (!ownAccount) {
|
||||
const parser = new htmlparser2.Parser({
|
||||
ontext (text: string) {
|
||||
const checkFilter = (filter: Mastodon.Filter) => {
|
||||
const escapedPhrase = filter.phrase.replace(
|
||||
/[.*+?^${}()|[\]\\]/g,
|
||||
'\\$&'
|
||||
) // $& means the whole matched string
|
||||
switch (filter.whole_word) {
|
||||
case true:
|
||||
if (new RegExp('\\b' + filter.phrase + '\\b').test(text)) {
|
||||
if (new RegExp('\\b' + escapedPhrase + '\\b').test(text)) {
|
||||
shouldFilter = true
|
||||
}
|
||||
break
|
||||
case false:
|
||||
if (new RegExp(filter.phrase).test(text)) {
|
||||
if (new RegExp(escapedPhrase).test(text)) {
|
||||
shouldFilter = true
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
instance?.filters.forEach(filter => {
|
||||
instance?.filters?.forEach(filter => {
|
||||
if (filter.expires_at) {
|
||||
if (new Date().getTime() > new Date(filter.expires_at).getTime()) {
|
||||
return
|
||||
|
@ -115,7 +115,7 @@ const TabSharedAccount: React.FC<SharedAccountProp> = ({
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}, [data, fetchedTimeline.current, i18n.language, mode])
|
||||
}, [data, fetchedTimeline.current, queryKey[1].page, i18n.language, mode])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
Loading…
x
Reference in New Issue
Block a user