mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Check for Wildebeest's account ID format
This commit is contained in:
@ -12,11 +12,11 @@ import TimelinePoll from '@components/Timeline/Shared/Poll'
|
|||||||
import { useNavigation } from '@react-navigation/native'
|
import { useNavigation } from '@react-navigation/native'
|
||||||
import { StackNavigationProp } from '@react-navigation/stack'
|
import { StackNavigationProp } from '@react-navigation/stack'
|
||||||
import { featureCheck } from '@utils/helpers/featureCheck'
|
import { featureCheck } from '@utils/helpers/featureCheck'
|
||||||
|
import { checkIsMyAccount } from '@utils/helpers/isMyAccount'
|
||||||
import removeHTML from '@utils/helpers/removeHTML'
|
import removeHTML from '@utils/helpers/removeHTML'
|
||||||
import { TabLocalStackParamList } from '@utils/navigation/navigators'
|
import { TabLocalStackParamList } from '@utils/navigation/navigators'
|
||||||
import { usePreferencesQuery } from '@utils/queryHooks/preferences'
|
import { usePreferencesQuery } from '@utils/queryHooks/preferences'
|
||||||
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
||||||
import { useAccountStorage } from '@utils/storage/actions'
|
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { Fragment, useRef, useState } from 'react'
|
import React, { Fragment, useRef, useState } from 'react'
|
||||||
@ -63,10 +63,9 @@ const TimelineDefault: React.FC<Props> = ({
|
|||||||
const { colors } = useTheme()
|
const { colors } = useTheme()
|
||||||
const navigation = useNavigation<StackNavigationProp<TabLocalStackParamList>>()
|
const navigation = useNavigation<StackNavigationProp<TabLocalStackParamList>>()
|
||||||
|
|
||||||
const [accountId] = useAccountStorage.string('auth.account.id')
|
|
||||||
const { data: preferences } = usePreferencesQuery()
|
const { data: preferences } = usePreferencesQuery()
|
||||||
|
|
||||||
const ownAccount = status.account?.id === accountId
|
const isMyAccount = checkIsMyAccount(status.account.id)
|
||||||
const [spoilerExpanded, setSpoilerExpanded] = useState(
|
const [spoilerExpanded, setSpoilerExpanded] = useState(
|
||||||
preferences?.['reading:expand:spoilers'] || false
|
preferences?.['reading:expand:spoilers'] || false
|
||||||
)
|
)
|
||||||
@ -136,7 +135,7 @@ const TimelineDefault: React.FC<Props> = ({
|
|||||||
const mStatus = menuStatus({ status, queryKey })
|
const mStatus = menuStatus({ status, queryKey })
|
||||||
const mInstance = menuInstance({ status, queryKey })
|
const mInstance = menuInstance({ status, queryKey })
|
||||||
|
|
||||||
if (!ownAccount) {
|
if (!isMyAccount) {
|
||||||
let filterResults: FilteredProps['filterResults'] = []
|
let filterResults: FilteredProps['filterResults'] = []
|
||||||
const [filterRevealed, setFilterRevealed] = useState(false)
|
const [filterRevealed, setFilterRevealed] = useState(false)
|
||||||
const hasFilterServerSide = featureCheck('filter_server_side')
|
const hasFilterServerSide = featureCheck('filter_server_side')
|
||||||
@ -166,7 +165,7 @@ const TimelineDefault: React.FC<Props> = ({
|
|||||||
value={{
|
value={{
|
||||||
queryKey,
|
queryKey,
|
||||||
status,
|
status,
|
||||||
ownAccount,
|
isMyAccount,
|
||||||
spoilerHidden,
|
spoilerHidden,
|
||||||
rawContent,
|
rawContent,
|
||||||
detectedLanguage,
|
detectedLanguage,
|
||||||
|
@ -12,10 +12,10 @@ import TimelinePoll from '@components/Timeline/Shared/Poll'
|
|||||||
import { useNavigation } from '@react-navigation/native'
|
import { useNavigation } from '@react-navigation/native'
|
||||||
import { StackNavigationProp } from '@react-navigation/stack'
|
import { StackNavigationProp } from '@react-navigation/stack'
|
||||||
import { featureCheck } from '@utils/helpers/featureCheck'
|
import { featureCheck } from '@utils/helpers/featureCheck'
|
||||||
|
import { checkIsMyAccount } from '@utils/helpers/isMyAccount'
|
||||||
import { TabLocalStackParamList } from '@utils/navigation/navigators'
|
import { TabLocalStackParamList } from '@utils/navigation/navigators'
|
||||||
import { usePreferencesQuery } from '@utils/queryHooks/preferences'
|
import { usePreferencesQuery } from '@utils/queryHooks/preferences'
|
||||||
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
||||||
import { useAccountStorage } from '@utils/storage/actions'
|
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { Fragment, useState } from 'react'
|
import React, { Fragment, useState } from 'react'
|
||||||
@ -32,7 +32,6 @@ export interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TimelineNotifications: React.FC<Props> = ({ notification, queryKey }) => {
|
const TimelineNotifications: React.FC<Props> = ({ notification, queryKey }) => {
|
||||||
const [accountId] = useAccountStorage.string('auth.account.id')
|
|
||||||
const { data: preferences } = usePreferencesQuery()
|
const { data: preferences } = usePreferencesQuery()
|
||||||
|
|
||||||
const status = notification.status?.reblog ? notification.status.reblog : notification.status
|
const status = notification.status?.reblog ? notification.status.reblog : notification.status
|
||||||
@ -42,7 +41,7 @@ const TimelineNotifications: React.FC<Props> = ({ notification, queryKey }) => {
|
|||||||
: notification.status
|
: notification.status
|
||||||
? notification.status.account
|
? notification.status.account
|
||||||
: notification.account
|
: notification.account
|
||||||
const ownAccount = notification.account?.id === accountId
|
const isMyAccount = checkIsMyAccount(notification.account?.id)
|
||||||
const [spoilerExpanded, setSpoilerExpanded] = useState(
|
const [spoilerExpanded, setSpoilerExpanded] = useState(
|
||||||
preferences?.['reading:expand:spoilers'] || false
|
preferences?.['reading:expand:spoilers'] || false
|
||||||
)
|
)
|
||||||
@ -109,7 +108,7 @@ const TimelineNotifications: React.FC<Props> = ({ notification, queryKey }) => {
|
|||||||
const mStatus = menuStatus({ status: notification.status, queryKey })
|
const mStatus = menuStatus({ status: notification.status, queryKey })
|
||||||
const mInstance = menuInstance({ status: notification.status, queryKey })
|
const mInstance = menuInstance({ status: notification.status, queryKey })
|
||||||
|
|
||||||
if (!ownAccount) {
|
if (!isMyAccount) {
|
||||||
let filterResults: FilteredProps['filterResults'] = []
|
let filterResults: FilteredProps['filterResults'] = []
|
||||||
const [filterRevealed, setFilterRevealed] = useState(false)
|
const [filterRevealed, setFilterRevealed] = useState(false)
|
||||||
const hasFilterServerSide = featureCheck('filter_server_side')
|
const hasFilterServerSide = featureCheck('filter_server_side')
|
||||||
@ -140,7 +139,7 @@ const TimelineNotifications: React.FC<Props> = ({ notification, queryKey }) => {
|
|||||||
value={{
|
value={{
|
||||||
queryKey,
|
queryKey,
|
||||||
status,
|
status,
|
||||||
ownAccount,
|
isMyAccount,
|
||||||
spoilerHidden
|
spoilerHidden
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -22,7 +22,7 @@ import { Pressable, StyleSheet, View } from 'react-native'
|
|||||||
import StatusContext from './Context'
|
import StatusContext from './Context'
|
||||||
|
|
||||||
const TimelineActions: React.FC = () => {
|
const TimelineActions: React.FC = () => {
|
||||||
const { queryKey, status, ownAccount, highlighted, disableDetails } = useContext(StatusContext)
|
const { queryKey, status, isMyAccount, highlighted, disableDetails } = useContext(StatusContext)
|
||||||
if (!queryKey || !status || disableDetails) return null
|
if (!queryKey || !status || disableDetails) return null
|
||||||
|
|
||||||
const navigationState = useNavState()
|
const navigationState = useNavState()
|
||||||
@ -182,7 +182,7 @@ const TimelineActions: React.FC = () => {
|
|||||||
const childrenReblog = () => {
|
const childrenReblog = () => {
|
||||||
const color = (state: boolean) => (state ? colors.green : colors.secondary)
|
const color = (state: boolean) => (state ? colors.green : colors.secondary)
|
||||||
const disabled =
|
const disabled =
|
||||||
status.visibility === 'direct' || (status.visibility === 'private' && !ownAccount)
|
status.visibility === 'direct' || (status.visibility === 'private' && !isMyAccount)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Icon
|
<Icon
|
||||||
@ -196,7 +196,7 @@ const TimelineActions: React.FC = () => {
|
|||||||
fontStyle='S'
|
fontStyle='S'
|
||||||
style={{
|
style={{
|
||||||
color:
|
color:
|
||||||
status.visibility === 'private' && !ownAccount
|
status.visibility === 'private' && !isMyAccount
|
||||||
? colors.disabled
|
? colors.disabled
|
||||||
: color(status.reblogged),
|
: color(status.reblogged),
|
||||||
marginLeft: StyleConstants.Spacing.XS
|
marginLeft: StyleConstants.Spacing.XS
|
||||||
@ -258,7 +258,7 @@ const TimelineActions: React.FC = () => {
|
|||||||
onPress={onPressReblog}
|
onPress={onPressReblog}
|
||||||
children={childrenReblog()}
|
children={childrenReblog()}
|
||||||
disabled={
|
disabled={
|
||||||
status.visibility === 'direct' || (status.visibility === 'private' && !ownAccount)
|
status.visibility === 'direct' || (status.visibility === 'private' && !isMyAccount)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ type StatusContextType = {
|
|||||||
|
|
||||||
status?: Mastodon.Status
|
status?: Mastodon.Status
|
||||||
|
|
||||||
ownAccount?: boolean
|
isMyAccount?: boolean
|
||||||
spoilerHidden?: boolean
|
spoilerHidden?: boolean
|
||||||
rawContent?: React.MutableRefObject<string[]> // When highlighted, for translate, edit history
|
rawContent?: React.MutableRefObject<string[]> // When highlighted, for translate, edit history
|
||||||
detectedLanguage?: React.MutableRefObject<string>
|
detectedLanguage?: React.MutableRefObject<string>
|
||||||
|
@ -21,7 +21,7 @@ import { Pressable, View } from 'react-native'
|
|||||||
import StatusContext from './Context'
|
import StatusContext from './Context'
|
||||||
|
|
||||||
const TimelinePoll: React.FC = () => {
|
const TimelinePoll: React.FC = () => {
|
||||||
const { queryKey, status, ownAccount, spoilerHidden, disableDetails, highlighted } =
|
const { queryKey, status, isMyAccount, spoilerHidden, disableDetails, highlighted } =
|
||||||
useContext(StatusContext)
|
useContext(StatusContext)
|
||||||
if (!queryKey || !status || !status.poll) return null
|
if (!queryKey || !status || !status.poll) return null
|
||||||
const poll = status.poll
|
const poll = status.poll
|
||||||
@ -72,7 +72,7 @@ const TimelinePoll: React.FC = () => {
|
|||||||
|
|
||||||
const pollButton = () => {
|
const pollButton = () => {
|
||||||
if (!poll.expired) {
|
if (!poll.expired) {
|
||||||
if (!ownAccount && !poll.voted) {
|
if (!isMyAccount && !poll.voted) {
|
||||||
return (
|
return (
|
||||||
<View style={{ marginRight: StyleConstants.Spacing.S }}>
|
<View style={{ marginRight: StyleConstants.Spacing.S }}>
|
||||||
<Button
|
<Button
|
||||||
|
@ -4,6 +4,7 @@ import { useNavigation } from '@react-navigation/native'
|
|||||||
import { NativeStackNavigationProp } from '@react-navigation/native-stack'
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack'
|
||||||
import { useQueryClient } from '@tanstack/react-query'
|
import { useQueryClient } from '@tanstack/react-query'
|
||||||
import apiInstance from '@utils/api/instance'
|
import apiInstance from '@utils/api/instance'
|
||||||
|
import { checkIsMyAccount } from '@utils/helpers/isMyAccount'
|
||||||
import { TabSharedStackParamList, useNavState } from '@utils/navigation/navigators'
|
import { TabSharedStackParamList, useNavState } from '@utils/navigation/navigators'
|
||||||
import { useAccountQuery } from '@utils/queryHooks/account'
|
import { useAccountQuery } from '@utils/queryHooks/account'
|
||||||
import {
|
import {
|
||||||
@ -15,7 +16,7 @@ import {
|
|||||||
MutationVarsTimelineUpdateAccountProperty,
|
MutationVarsTimelineUpdateAccountProperty,
|
||||||
useTimelineMutation
|
useTimelineMutation
|
||||||
} from '@utils/queryHooks/timeline'
|
} from '@utils/queryHooks/timeline'
|
||||||
import { getAccountStorage, getReadableAccounts, useAccountStorage } from '@utils/storage/actions'
|
import { getAccountStorage, getReadableAccounts } from '@utils/storage/actions'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Alert, Platform } from 'react-native'
|
import { Alert, Platform } from 'react-native'
|
||||||
@ -40,19 +41,18 @@ const menuAccount = ({
|
|||||||
|
|
||||||
const [enabled, setEnabled] = useState(openChange)
|
const [enabled, setEnabled] = useState(openChange)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!ownAccount && enabled === false && openChange === true) {
|
if (!isMyAccount && enabled === false && openChange === true) {
|
||||||
setEnabled(true)
|
setEnabled(true)
|
||||||
}
|
}
|
||||||
}, [openChange, enabled])
|
}, [openChange, enabled])
|
||||||
const { data: fetchedAccount } = useAccountQuery({ account, _local: true, options: { enabled } })
|
const { data: fetchedAccount } = useAccountQuery({ account, _local: true, options: { enabled } })
|
||||||
const actualAccount = status?._remote ? fetchedAccount : account
|
const actualAccount = status?._remote ? fetchedAccount : account
|
||||||
|
const isMyAccount = checkIsMyAccount(actualAccount?.id)
|
||||||
const { data, isFetched } = useRelationshipQuery({
|
const { data, isFetched } = useRelationshipQuery({
|
||||||
id: actualAccount?.id,
|
id: actualAccount?.id,
|
||||||
options: { enabled: !!actualAccount?.id && enabled }
|
options: { enabled: !!actualAccount?.id && enabled }
|
||||||
})
|
})
|
||||||
|
|
||||||
const ownAccount = useAccountStorage.string('auth.account.id')['0'] === actualAccount?.id
|
|
||||||
|
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const timelineMutation = useTimelineMutation({
|
const timelineMutation = useTimelineMutation({
|
||||||
onSuccess: (_, params) => {
|
onSuccess: (_, params) => {
|
||||||
@ -134,7 +134,7 @@ const menuAccount = ({
|
|||||||
|
|
||||||
if (!account) return []
|
if (!account) return []
|
||||||
|
|
||||||
if (!ownAccount && Platform.OS !== 'android' && type !== 'account') {
|
if (!isMyAccount && Platform.OS !== 'android' && type !== 'account') {
|
||||||
menus[0].push({
|
menus[0].push({
|
||||||
type: 'item',
|
type: 'item',
|
||||||
key: 'account-following',
|
key: 'account-following',
|
||||||
@ -165,7 +165,7 @@ const menuAccount = ({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ownAccount) {
|
if (!isMyAccount) {
|
||||||
menus[0].push({
|
menus[0].push({
|
||||||
type: 'item',
|
type: 'item',
|
||||||
key: 'account-list',
|
key: 'account-list',
|
||||||
|
@ -4,6 +4,7 @@ import { NativeStackNavigationProp } from '@react-navigation/native-stack'
|
|||||||
import { useQueryClient } from '@tanstack/react-query'
|
import { useQueryClient } from '@tanstack/react-query'
|
||||||
import apiInstance from '@utils/api/instance'
|
import apiInstance from '@utils/api/instance'
|
||||||
import { featureCheck } from '@utils/helpers/featureCheck'
|
import { featureCheck } from '@utils/helpers/featureCheck'
|
||||||
|
import { checkIsMyAccount } from '@utils/helpers/isMyAccount'
|
||||||
import { RootStackParamList, useNavState } from '@utils/navigation/navigators'
|
import { RootStackParamList, useNavState } from '@utils/navigation/navigators'
|
||||||
import {
|
import {
|
||||||
MutationVarsTimelineUpdateStatusProperty,
|
MutationVarsTimelineUpdateStatusProperty,
|
||||||
@ -57,9 +58,8 @@ const menuStatus = ({
|
|||||||
|
|
||||||
const menus: ContextMenu = []
|
const menus: ContextMenu = []
|
||||||
|
|
||||||
const [accountId] = useAccountStorage.string('auth.account.id')
|
|
||||||
const [accountAcct] = useAccountStorage.string('auth.account.acct')
|
const [accountAcct] = useAccountStorage.string('auth.account.acct')
|
||||||
const ownAccount = accountId === status.account?.id
|
const isMyAccount = checkIsMyAccount(status.account.id)
|
||||||
|
|
||||||
const canEditPost = featureCheck('edit_post')
|
const canEditPost = featureCheck('edit_post')
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ const menuStatus = ({
|
|||||||
},
|
},
|
||||||
disabled: false,
|
disabled: false,
|
||||||
destructive: false,
|
destructive: false,
|
||||||
hidden: !ownAccount || !canEditPost
|
hidden: !isMyAccount || !canEditPost
|
||||||
},
|
},
|
||||||
title: t('componentContextMenu:status.edit.action'),
|
title: t('componentContextMenu:status.edit.action'),
|
||||||
icon: 'square.and.pencil'
|
icon: 'square.and.pencil'
|
||||||
@ -142,7 +142,7 @@ const menuStatus = ({
|
|||||||
),
|
),
|
||||||
disabled: false,
|
disabled: false,
|
||||||
destructive: true,
|
destructive: true,
|
||||||
hidden: !ownAccount
|
hidden: !isMyAccount
|
||||||
},
|
},
|
||||||
title: t('componentContextMenu:status.deleteEdit.action'),
|
title: t('componentContextMenu:status.deleteEdit.action'),
|
||||||
icon: 'pencil.and.outline'
|
icon: 'pencil.and.outline'
|
||||||
@ -171,7 +171,7 @@ const menuStatus = ({
|
|||||||
),
|
),
|
||||||
disabled: false,
|
disabled: false,
|
||||||
destructive: true,
|
destructive: true,
|
||||||
hidden: !ownAccount
|
hidden: !isMyAccount
|
||||||
},
|
},
|
||||||
title: t('componentContextMenu:status.delete.action'),
|
title: t('componentContextMenu:status.delete.action'),
|
||||||
icon: 'trash'
|
icon: 'trash'
|
||||||
@ -195,7 +195,7 @@ const menuStatus = ({
|
|||||||
disabled: false,
|
disabled: false,
|
||||||
destructive: false,
|
destructive: false,
|
||||||
hidden:
|
hidden:
|
||||||
!ownAccount &&
|
!isMyAccount &&
|
||||||
queryKey[1].page !== 'Notifications' &&
|
queryKey[1].page !== 'Notifications' &&
|
||||||
!status.mentions?.find(
|
!status.mentions?.find(
|
||||||
mention => mention.acct === accountAcct && mention.username === accountAcct
|
mention => mention.acct === accountAcct && mention.username === accountAcct
|
||||||
@ -224,7 +224,7 @@ const menuStatus = ({
|
|||||||
}),
|
}),
|
||||||
disabled: status.visibility !== 'public' && status.visibility !== 'unlisted',
|
disabled: status.visibility !== 'public' && status.visibility !== 'unlisted',
|
||||||
destructive: false,
|
destructive: false,
|
||||||
hidden: !ownAccount
|
hidden: !isMyAccount
|
||||||
},
|
},
|
||||||
title: t('componentContextMenu:status.pin.action', {
|
title: t('componentContextMenu:status.pin.action', {
|
||||||
defaultValue: 'false',
|
defaultValue: 'false',
|
||||||
@ -236,8 +236,9 @@ const menuStatus = ({
|
|||||||
type: 'item',
|
type: 'item',
|
||||||
key: 'status-filter',
|
key: 'status-filter',
|
||||||
props: {
|
props: {
|
||||||
// @ts-ignore
|
onSelect: () =>
|
||||||
onSelect: () => navigation.navigate('Tab-Shared-Filter', { source: 'status', status, queryKey }),
|
// @ts-ignore
|
||||||
|
navigation.navigate('Tab-Shared-Filter', { source: 'status', status, queryKey }),
|
||||||
disabled: false,
|
disabled: false,
|
||||||
destructive: false,
|
destructive: false,
|
||||||
hidden: !('filtered' in status)
|
hidden: !('filtered' in status)
|
||||||
|
@ -2,7 +2,7 @@ import Button from '@components/Button'
|
|||||||
import menuAt from '@components/contextMenu/at'
|
import menuAt from '@components/contextMenu/at'
|
||||||
import { RelationshipOutgoing } from '@components/Relationship'
|
import { RelationshipOutgoing } from '@components/Relationship'
|
||||||
import { useNavigation } from '@react-navigation/native'
|
import { useNavigation } from '@react-navigation/native'
|
||||||
import { useAccountStorage } from '@utils/storage/actions'
|
import { checkIsMyAccount } from '@utils/helpers/isMyAccount'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import React, { useContext } from 'react'
|
import React, { useContext } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -56,12 +56,11 @@ const AccountInformationActions: React.FC = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const [accountId] = useAccountStorage.string('auth.account.id')
|
const isMyAccount = checkIsMyAccount(account?.id)
|
||||||
const ownAccount = account?.id === accountId
|
|
||||||
|
|
||||||
const mAt = menuAt({ account })
|
const mAt = menuAt({ account })
|
||||||
|
|
||||||
if (!ownAccount && account) {
|
if (!isMyAccount && account) {
|
||||||
return (
|
return (
|
||||||
<View style={styles.base}>
|
<View style={styles.base}>
|
||||||
{relationship && !relationship.blocked_by ? (
|
{relationship && !relationship.blocked_by ? (
|
||||||
|
9
src/utils/helpers/isMyAccount.ts
Normal file
9
src/utils/helpers/isMyAccount.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { getAccountStorage } from '@utils/storage/actions'
|
||||||
|
|
||||||
|
export const checkIsMyAccount = (id?: Mastodon.Account['id']): boolean => {
|
||||||
|
if (!id) return false
|
||||||
|
|
||||||
|
const accountId = getAccountStorage.string('auth.account.id')
|
||||||
|
const accountDomain = getAccountStorage.string('auth.account.domain')
|
||||||
|
return accountId === id || `${accountId}@${accountDomain}` === id
|
||||||
|
}
|
Reference in New Issue
Block a user