[🐴] only try to initialize once in the NUX (#4142)
* only try to initialize once * nit
This commit is contained in:
parent
184c65836b
commit
8cec1679a7
1 changed files with 5 additions and 2 deletions
|
@ -53,6 +53,8 @@ function DialogInner({
|
|||
const control = Dialog.useDialogContext()
|
||||
const {_} = useLingui()
|
||||
const t = useTheme()
|
||||
|
||||
const [initialized, setInitialzed] = React.useState(false)
|
||||
const {mutate: updateDeclaration} = useUpdateActorDeclaration({
|
||||
onError: () => {
|
||||
Toast.show(_(msg`Failed to update settings`))
|
||||
|
@ -69,10 +71,11 @@ function DialogInner({
|
|||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (!chatDeclation) {
|
||||
if (!chatDeclation && !initialized) {
|
||||
updateDeclaration('following')
|
||||
setInitialzed(true)
|
||||
}
|
||||
}, [chatDeclation, updateDeclaration])
|
||||
}, [chatDeclation, updateDeclaration, initialized])
|
||||
|
||||
return (
|
||||
<Dialog.ScrollableInner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue