Create codemod for addressing ESLint warnings (#10032)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
import {useCallback, useState} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
@@ -36,10 +36,10 @@ function DeactivateAccountDialogInner({
|
||||
const {_} = useLingui()
|
||||
const agent = useAgent()
|
||||
const {logoutCurrentAccount} = useSessionApi()
|
||||
const [pending, setPending] = React.useState(false)
|
||||
const [error, setError] = React.useState<string | undefined>()
|
||||
const [pending, setPending] = useState(false)
|
||||
const [error, setError] = useState<string | undefined>()
|
||||
|
||||
const handleDeactivate = React.useCallback(async () => {
|
||||
const handleDeactivate = useCallback(async () => {
|
||||
try {
|
||||
setPending(true)
|
||||
await agent.com.atproto.server.deactivateAccount({})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
import {useCallback} from 'react'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
@@ -17,7 +17,7 @@ export function Email2FAToggle() {
|
||||
const disableDialogControl = useDialogControl()
|
||||
const emailDialogControl = useEmailDialogControl()
|
||||
|
||||
const onToggle = React.useCallback(() => {
|
||||
const onToggle = useCallback(() => {
|
||||
emailDialogControl.open({
|
||||
id: EmailDialogScreenID.Manage2FA,
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
import {useCallback} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {type $Typed, ComAtprotoLabelDefs} from '@atproto/api'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
@@ -26,7 +26,7 @@ export function PwiOptOut() {
|
||||
profile?.labels?.some(l => l.val === '!no-unauthenticated') || false
|
||||
const canToggle = profile && !updateProfile.isPending
|
||||
|
||||
const onToggleOptOut = React.useCallback(() => {
|
||||
const onToggleOptOut = useCallback(() => {
|
||||
if (!profile) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user