mirror of
https://github.com/tooot-app/app
synced 2025-02-01 19:16:56 +01:00
Black list path format includes @ but not Mastodon
This commit is contained in:
parent
5c3e490112
commit
aba239188f
@ -1,6 +1,9 @@
|
|||||||
import { getAccountStorage } from '@utils/storage/actions'
|
import { getAccountStorage } from '@utils/storage/actions'
|
||||||
import parse from 'url-parse'
|
import parse from 'url-parse'
|
||||||
|
|
||||||
|
// Would mess with the /@username format
|
||||||
|
const BLACK_LIST = ['matters.news', 'medium.com']
|
||||||
|
|
||||||
export const urlMatcher = (
|
export const urlMatcher = (
|
||||||
url: string
|
url: string
|
||||||
):
|
):
|
||||||
@ -14,6 +17,10 @@ export const urlMatcher = (
|
|||||||
if (!parsed.hostname.length || !parsed.pathname.length) return undefined
|
if (!parsed.hostname.length || !parsed.pathname.length) return undefined
|
||||||
|
|
||||||
const domain = parsed.hostname
|
const domain = parsed.hostname
|
||||||
|
if (BLACK_LIST.includes(domain)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const _remote = parsed.hostname !== getAccountStorage.string('auth.domain')
|
const _remote = parsed.hostname !== getAccountStorage.string('auth.domain')
|
||||||
|
|
||||||
let statusId: string | undefined
|
let statusId: string | undefined
|
||||||
|
Loading…
x
Reference in New Issue
Block a user