parent
184c65836b
commit
8cec1679a7
|
@ -53,6 +53,8 @@ function DialogInner({
|
||||||
const control = Dialog.useDialogContext()
|
const control = Dialog.useDialogContext()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|
||||||
|
const [initialized, setInitialzed] = React.useState(false)
|
||||||
const {mutate: updateDeclaration} = useUpdateActorDeclaration({
|
const {mutate: updateDeclaration} = useUpdateActorDeclaration({
|
||||||
onError: () => {
|
onError: () => {
|
||||||
Toast.show(_(msg`Failed to update settings`))
|
Toast.show(_(msg`Failed to update settings`))
|
||||||
|
@ -69,10 +71,11 @@ function DialogInner({
|
||||||
)
|
)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!chatDeclation) {
|
if (!chatDeclation && !initialized) {
|
||||||
updateDeclaration('following')
|
updateDeclaration('following')
|
||||||
|
setInitialzed(true)
|
||||||
}
|
}
|
||||||
}, [chatDeclation, updateDeclaration])
|
}, [chatDeclation, updateDeclaration, initialized])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
|
|
Loading…
Reference in New Issue