Refactor app passwords to use react-query (#1932)
This commit is contained in:
parent
310a7eaca7
commit
9f7a162a96
6 changed files with 177 additions and 115 deletions
|
@ -1,5 +1,4 @@
|
||||||
import {makeAutoObservable, runInAction} from 'mobx'
|
import {makeAutoObservable, runInAction} from 'mobx'
|
||||||
import {ComAtprotoServerListAppPasswords} from '@atproto/api'
|
|
||||||
import {RootStoreModel} from './root-store'
|
import {RootStoreModel} from './root-store'
|
||||||
import {isObj, hasProp} from 'lib/type-guards'
|
import {isObj, hasProp} from 'lib/type-guards'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
|
@ -14,7 +13,6 @@ export class MeModel {
|
||||||
avatar: string = ''
|
avatar: string = ''
|
||||||
followsCount: number | undefined
|
followsCount: number | undefined
|
||||||
followersCount: number | undefined
|
followersCount: number | undefined
|
||||||
appPasswords: ComAtprotoServerListAppPasswords.AppPassword[] = []
|
|
||||||
lastProfileStateUpdate = Date.now()
|
lastProfileStateUpdate = Date.now()
|
||||||
|
|
||||||
constructor(public rootStore: RootStoreModel) {
|
constructor(public rootStore: RootStoreModel) {
|
||||||
|
@ -33,7 +31,6 @@ export class MeModel {
|
||||||
this.displayName = ''
|
this.displayName = ''
|
||||||
this.description = ''
|
this.description = ''
|
||||||
this.avatar = ''
|
this.avatar = ''
|
||||||
this.appPasswords = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
serialize(): unknown {
|
serialize(): unknown {
|
||||||
|
@ -81,7 +78,6 @@ export class MeModel {
|
||||||
this.did = sess.currentSession?.did || ''
|
this.did = sess.currentSession?.did || ''
|
||||||
await this.fetchProfile()
|
await this.fetchProfile()
|
||||||
this.rootStore.emitSessionLoaded()
|
this.rootStore.emitSessionLoaded()
|
||||||
await this.fetchAppPasswords()
|
|
||||||
} else {
|
} else {
|
||||||
this.clear()
|
this.clear()
|
||||||
}
|
}
|
||||||
|
@ -92,7 +88,6 @@ export class MeModel {
|
||||||
logger.debug('Updating me profile information')
|
logger.debug('Updating me profile information')
|
||||||
this.lastProfileStateUpdate = Date.now()
|
this.lastProfileStateUpdate = Date.now()
|
||||||
await this.fetchProfile()
|
await this.fetchProfile()
|
||||||
await this.fetchAppPasswords()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,56 +112,4 @@ export class MeModel {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchAppPasswords() {
|
|
||||||
if (this.rootStore.session) {
|
|
||||||
try {
|
|
||||||
const res =
|
|
||||||
await this.rootStore.agent.com.atproto.server.listAppPasswords({})
|
|
||||||
runInAction(() => {
|
|
||||||
this.appPasswords = res.data.passwords
|
|
||||||
})
|
|
||||||
} catch (e) {
|
|
||||||
logger.error('Failed to fetch user app passwords', {
|
|
||||||
error: e,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async createAppPassword(name: string) {
|
|
||||||
if (this.rootStore.session) {
|
|
||||||
try {
|
|
||||||
if (this.appPasswords.find(p => p.name === name)) {
|
|
||||||
// TODO: this should be handled by the backend but it's not
|
|
||||||
throw new Error('App password with this name already exists')
|
|
||||||
}
|
|
||||||
const res =
|
|
||||||
await this.rootStore.agent.com.atproto.server.createAppPassword({
|
|
||||||
name,
|
|
||||||
})
|
|
||||||
runInAction(() => {
|
|
||||||
this.appPasswords.push(res.data)
|
|
||||||
})
|
|
||||||
return res.data
|
|
||||||
} catch (e) {
|
|
||||||
logger.error('Failed to create app password', {error: e})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async deleteAppPassword(name: string) {
|
|
||||||
if (this.rootStore.session) {
|
|
||||||
try {
|
|
||||||
await this.rootStore.agent.com.atproto.server.revokeAppPassword({
|
|
||||||
name: name,
|
|
||||||
})
|
|
||||||
runInAction(() => {
|
|
||||||
this.appPasswords = this.appPasswords.filter(p => p.name !== name)
|
|
||||||
})
|
|
||||||
} catch (e) {
|
|
||||||
logger.error('Failed to delete app password', {error: e})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
56
src/state/queries/app-passwords.ts
Normal file
56
src/state/queries/app-passwords.ts
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
import {ComAtprotoServerCreateAppPassword} from '@atproto/api'
|
||||||
|
import {useQuery, useQueryClient, useMutation} from '@tanstack/react-query'
|
||||||
|
import {useSession} from '../session'
|
||||||
|
|
||||||
|
export const RQKEY = () => ['app-passwords']
|
||||||
|
|
||||||
|
export function useAppPasswordsQuery() {
|
||||||
|
const {agent} = useSession()
|
||||||
|
return useQuery({
|
||||||
|
queryKey: RQKEY(),
|
||||||
|
queryFn: async () => {
|
||||||
|
const res = await agent.com.atproto.server.listAppPasswords({})
|
||||||
|
return res.data.passwords
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useAppPasswordCreateMutation() {
|
||||||
|
const {agent} = useSession()
|
||||||
|
const queryClient = useQueryClient()
|
||||||
|
return useMutation<
|
||||||
|
ComAtprotoServerCreateAppPassword.OutputSchema,
|
||||||
|
Error,
|
||||||
|
{name: string}
|
||||||
|
>({
|
||||||
|
mutationFn: async ({name}) => {
|
||||||
|
return (
|
||||||
|
await agent.com.atproto.server.createAppPassword({
|
||||||
|
name,
|
||||||
|
})
|
||||||
|
).data
|
||||||
|
},
|
||||||
|
onSuccess() {
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: RQKEY(),
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useAppPasswordDeleteMutation() {
|
||||||
|
const {agent} = useSession()
|
||||||
|
const queryClient = useQueryClient()
|
||||||
|
return useMutation<void, Error, {name: string}>({
|
||||||
|
mutationFn: async ({name}) => {
|
||||||
|
await agent.com.atproto.server.revokeAppPassword({
|
||||||
|
name,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onSuccess() {
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: RQKEY(),
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
|
@ -3,7 +3,6 @@ import {StyleSheet, TextInput, View, TouchableOpacity} from 'react-native'
|
||||||
import {Text} from '../util/text/Text'
|
import {Text} from '../util/text/Text'
|
||||||
import {Button} from '../util/forms/Button'
|
import {Button} from '../util/forms/Button'
|
||||||
import {s} from 'lib/styles'
|
import {s} from 'lib/styles'
|
||||||
import {useStores} from 'state/index'
|
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
import {isNative} from 'platform/detection'
|
import {isNative} from 'platform/detection'
|
||||||
import {
|
import {
|
||||||
|
@ -16,6 +15,10 @@ import {logger} from '#/logger'
|
||||||
import {Trans, msg} from '@lingui/macro'
|
import {Trans, msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useModalControls} from '#/state/modals'
|
import {useModalControls} from '#/state/modals'
|
||||||
|
import {
|
||||||
|
useAppPasswordsQuery,
|
||||||
|
useAppPasswordCreateMutation,
|
||||||
|
} from '#/state/queries/app-passwords'
|
||||||
|
|
||||||
export const snapPoints = ['70%']
|
export const snapPoints = ['70%']
|
||||||
|
|
||||||
|
@ -56,9 +59,10 @@ const shadesOfBlue: string[] = [
|
||||||
|
|
||||||
export function Component({}: {}) {
|
export function Component({}: {}) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const store = useStores()
|
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const {closeModal} = useModalControls()
|
const {closeModal} = useModalControls()
|
||||||
|
const {data: passwords} = useAppPasswordsQuery()
|
||||||
|
const createMutation = useAppPasswordCreateMutation()
|
||||||
const [name, setName] = useState(
|
const [name, setName] = useState(
|
||||||
shadesOfBlue[Math.floor(Math.random() * shadesOfBlue.length)],
|
shadesOfBlue[Math.floor(Math.random() * shadesOfBlue.length)],
|
||||||
)
|
)
|
||||||
|
@ -82,25 +86,34 @@ export function Component({}: {}) {
|
||||||
if (!name || !name.trim()) {
|
if (!name || !name.trim()) {
|
||||||
Toast.show(
|
Toast.show(
|
||||||
'Please enter a name for your app password. All spaces is not allowed.',
|
'Please enter a name for your app password. All spaces is not allowed.',
|
||||||
|
'times',
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if name is too short (under 4 chars), we don't allow it
|
// if name is too short (under 4 chars), we don't allow it
|
||||||
if (name.length < 4) {
|
if (name.length < 4) {
|
||||||
Toast.show('App Password names must be at least 4 characters long.')
|
Toast.show(
|
||||||
|
'App Password names must be at least 4 characters long.',
|
||||||
|
'times',
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (passwords?.find(p => p.name === name)) {
|
||||||
|
Toast.show('This name is already in use', 'times')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const newPassword = await store.me.createAppPassword(name)
|
const newPassword = await createMutation.mutateAsync({name})
|
||||||
if (newPassword) {
|
if (newPassword) {
|
||||||
setAppPassword(newPassword.password)
|
setAppPassword(newPassword.password)
|
||||||
} else {
|
} else {
|
||||||
Toast.show('Failed to create app password.')
|
Toast.show('Failed to create app password.', 'times')
|
||||||
// TODO: better error handling (?)
|
// TODO: better error handling (?)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.show('Failed to create app password.')
|
Toast.show('Failed to create app password.', 'times')
|
||||||
logger.error('Failed to create app password', {error: e})
|
logger.error('Failed to create app password', {error: e})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import RootSiblings from 'react-native-root-siblings'
|
import RootSiblings from 'react-native-root-siblings'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {Animated, StyleSheet, View} from 'react-native'
|
import {Animated, StyleSheet, View} from 'react-native'
|
||||||
|
import {Props as FontAwesomeProps} from '@fortawesome/react-native-fontawesome'
|
||||||
import {Text} from './text/Text'
|
import {Text} from './text/Text'
|
||||||
import {colors} from 'lib/styles'
|
import {colors} from 'lib/styles'
|
||||||
import {useTheme} from 'lib/ThemeContext'
|
import {useTheme} from 'lib/ThemeContext'
|
||||||
|
@ -9,7 +10,10 @@ import {useAnimatedValue} from 'lib/hooks/useAnimatedValue'
|
||||||
|
|
||||||
const TIMEOUT = 4e3
|
const TIMEOUT = 4e3
|
||||||
|
|
||||||
export function show(message: string) {
|
export function show(
|
||||||
|
message: string,
|
||||||
|
_icon: FontAwesomeProps['icon'] = 'check',
|
||||||
|
) {
|
||||||
const item = new RootSiblings(<Toast message={message} />)
|
const item = new RootSiblings(<Toast message={message} />)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
item.destroy()
|
item.destroy()
|
||||||
|
|
|
@ -7,12 +7,14 @@ import {StyleSheet, Text, View} from 'react-native'
|
||||||
import {
|
import {
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon,
|
||||||
FontAwesomeIconStyle,
|
FontAwesomeIconStyle,
|
||||||
|
Props as FontAwesomeProps,
|
||||||
} from '@fortawesome/react-native-fontawesome'
|
} from '@fortawesome/react-native-fontawesome'
|
||||||
|
|
||||||
const DURATION = 3500
|
const DURATION = 3500
|
||||||
|
|
||||||
interface ActiveToast {
|
interface ActiveToast {
|
||||||
text: string
|
text: string
|
||||||
|
icon: FontAwesomeProps['icon']
|
||||||
}
|
}
|
||||||
type GlobalSetActiveToast = (_activeToast: ActiveToast | undefined) => void
|
type GlobalSetActiveToast = (_activeToast: ActiveToast | undefined) => void
|
||||||
|
|
||||||
|
@ -36,7 +38,7 @@ export const ToastContainer: React.FC<ToastContainerProps> = ({}) => {
|
||||||
{activeToast && (
|
{activeToast && (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon="check"
|
icon={activeToast.icon}
|
||||||
size={24}
|
size={24}
|
||||||
style={styles.icon as FontAwesomeIconStyle}
|
style={styles.icon as FontAwesomeIconStyle}
|
||||||
/>
|
/>
|
||||||
|
@ -49,11 +51,12 @@ export const ToastContainer: React.FC<ToastContainerProps> = ({}) => {
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
// =
|
// =
|
||||||
export function show(text: string) {
|
|
||||||
|
export function show(text: string, icon: FontAwesomeProps['icon'] = 'check') {
|
||||||
if (toastTimeout) {
|
if (toastTimeout) {
|
||||||
clearTimeout(toastTimeout)
|
clearTimeout(toastTimeout)
|
||||||
}
|
}
|
||||||
globalSetActiveToast?.({text})
|
globalSetActiveToast?.({text, icon})
|
||||||
toastTimeout = setTimeout(() => {
|
toastTimeout = setTimeout(() => {
|
||||||
globalSetActiveToast?.(undefined)
|
globalSetActiveToast?.(undefined)
|
||||||
}, DURATION)
|
}, DURATION)
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {StyleSheet, TouchableOpacity, View} from 'react-native'
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
StyleSheet,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from 'react-native'
|
||||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||||
import {ScrollView} from 'react-native-gesture-handler'
|
import {ScrollView} from 'react-native-gesture-handler'
|
||||||
import {Text} from '../com/util/text/Text'
|
import {Text} from '../com/util/text/Text'
|
||||||
import {Button} from '../com/util/forms/Button'
|
import {Button} from '../com/util/forms/Button'
|
||||||
import * as Toast from '../com/util/Toast'
|
import * as Toast from '../com/util/Toast'
|
||||||
import {useStores} from 'state/index'
|
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
||||||
import {withAuthRequired} from 'view/com/auth/withAuthRequired'
|
import {withAuthRequired} from 'view/com/auth/withAuthRequired'
|
||||||
import {observer} from 'mobx-react-lite'
|
|
||||||
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
import {CommonNavigatorParams} from 'lib/routes/types'
|
import {CommonNavigatorParams} from 'lib/routes/types'
|
||||||
import {useAnalytics} from 'lib/analytics/analytics'
|
import {useAnalytics} from 'lib/analytics/analytics'
|
||||||
|
@ -21,16 +24,22 @@ import {useLingui} from '@lingui/react'
|
||||||
import {useSetMinimalShellMode} from '#/state/shell'
|
import {useSetMinimalShellMode} from '#/state/shell'
|
||||||
import {useModalControls} from '#/state/modals'
|
import {useModalControls} from '#/state/modals'
|
||||||
import {useLanguagePrefs} from '#/state/preferences'
|
import {useLanguagePrefs} from '#/state/preferences'
|
||||||
|
import {
|
||||||
|
useAppPasswordsQuery,
|
||||||
|
useAppPasswordDeleteMutation,
|
||||||
|
} from '#/state/queries/app-passwords'
|
||||||
|
import {ErrorScreen} from '../com/util/error/ErrorScreen'
|
||||||
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
|
|
||||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'AppPasswords'>
|
type Props = NativeStackScreenProps<CommonNavigatorParams, 'AppPasswords'>
|
||||||
export const AppPasswords = withAuthRequired(
|
export const AppPasswords = withAuthRequired(
|
||||||
observer(function AppPasswordsImpl({}: Props) {
|
function AppPasswordsImpl({}: Props) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const store = useStores()
|
|
||||||
const setMinimalShellMode = useSetMinimalShellMode()
|
const setMinimalShellMode = useSetMinimalShellMode()
|
||||||
const {screen} = useAnalytics()
|
const {screen} = useAnalytics()
|
||||||
const {isTabletOrDesktop} = useWebMediaQueries()
|
const {isTabletOrDesktop} = useWebMediaQueries()
|
||||||
const {openModal} = useModalControls()
|
const {openModal} = useModalControls()
|
||||||
|
const {data: appPasswords, error} = useAppPasswordsQuery()
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
React.useCallback(() => {
|
React.useCallback(() => {
|
||||||
|
@ -43,8 +52,27 @@ export const AppPasswords = withAuthRequired(
|
||||||
openModal({name: 'add-app-password'})
|
openModal({name: 'add-app-password'})
|
||||||
}, [openModal])
|
}, [openModal])
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
return (
|
||||||
|
<CenteredView
|
||||||
|
style={[
|
||||||
|
styles.container,
|
||||||
|
isTabletOrDesktop && styles.containerDesktop,
|
||||||
|
pal.view,
|
||||||
|
pal.border,
|
||||||
|
]}
|
||||||
|
testID="appPasswordsScreen">
|
||||||
|
<ErrorScreen
|
||||||
|
title="Oops!"
|
||||||
|
message="There was an issue with fetching your app passwords"
|
||||||
|
details={cleanError(error)}
|
||||||
|
/>
|
||||||
|
</CenteredView>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// no app passwords (empty) state
|
// no app passwords (empty) state
|
||||||
if (store.me.appPasswords.length === 0) {
|
if (appPasswords?.length === 0) {
|
||||||
return (
|
return (
|
||||||
<CenteredView
|
<CenteredView
|
||||||
style={[
|
style={[
|
||||||
|
@ -82,6 +110,7 @@ export const AppPasswords = withAuthRequired(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (appPasswords?.length) {
|
||||||
// has app passwords
|
// has app passwords
|
||||||
return (
|
return (
|
||||||
<CenteredView
|
<CenteredView
|
||||||
|
@ -99,7 +128,7 @@ export const AppPasswords = withAuthRequired(
|
||||||
pal.border,
|
pal.border,
|
||||||
!isTabletOrDesktop && styles.flex1,
|
!isTabletOrDesktop && styles.flex1,
|
||||||
]}>
|
]}>
|
||||||
{store.me.appPasswords.map((password, i) => (
|
{appPasswords.map((password, i) => (
|
||||||
<AppPassword
|
<AppPassword
|
||||||
key={password.name}
|
key={password.name}
|
||||||
testID={`appPassword-${i}`}
|
testID={`appPassword-${i}`}
|
||||||
|
@ -134,7 +163,21 @@ export const AppPasswords = withAuthRequired(
|
||||||
)}
|
)}
|
||||||
</CenteredView>
|
</CenteredView>
|
||||||
)
|
)
|
||||||
}),
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<CenteredView
|
||||||
|
style={[
|
||||||
|
styles.container,
|
||||||
|
isTabletOrDesktop && styles.containerDesktop,
|
||||||
|
pal.view,
|
||||||
|
pal.border,
|
||||||
|
]}
|
||||||
|
testID="appPasswordsScreen">
|
||||||
|
<ActivityIndicator />
|
||||||
|
</CenteredView>
|
||||||
|
)
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
function AppPasswordsHeader() {
|
function AppPasswordsHeader() {
|
||||||
|
@ -169,10 +212,10 @@ function AppPassword({
|
||||||
createdAt: string
|
createdAt: string
|
||||||
}) {
|
}) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const store = useStores()
|
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const {openModal} = useModalControls()
|
const {openModal} = useModalControls()
|
||||||
const {contentLanguages} = useLanguagePrefs()
|
const {contentLanguages} = useLanguagePrefs()
|
||||||
|
const deleteMutation = useAppPasswordDeleteMutation()
|
||||||
|
|
||||||
const onDelete = React.useCallback(async () => {
|
const onDelete = React.useCallback(async () => {
|
||||||
openModal({
|
openModal({
|
||||||
|
@ -180,11 +223,11 @@ function AppPassword({
|
||||||
title: 'Delete App Password',
|
title: 'Delete App Password',
|
||||||
message: `Are you sure you want to delete the app password "${name}"?`,
|
message: `Are you sure you want to delete the app password "${name}"?`,
|
||||||
async onPressConfirm() {
|
async onPressConfirm() {
|
||||||
await store.me.deleteAppPassword(name)
|
await deleteMutation.mutateAsync({name})
|
||||||
Toast.show('App password deleted')
|
Toast.show('App password deleted')
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}, [store, openModal, name])
|
}, [deleteMutation, openModal, name])
|
||||||
|
|
||||||
const primaryLocale =
|
const primaryLocale =
|
||||||
contentLanguages.length > 0 ? contentLanguages[0] : 'en-US'
|
contentLanguages.length > 0 ? contentLanguages[0] : 'en-US'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue