File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1- import { useState } from "react" ;
1+ import { useEffect , useState } from "react" ;
22import { useTranslation } from "react-i18next" ;
33import { NeedRestart } from "@/components/shared/System" ;
44import {
@@ -43,10 +43,16 @@ function AppUpdateModal({
4343 install : ReturnType < typeof useUpdater > [ "install" ] ;
4444} ) {
4545 const { t } = useTranslation ( ) ;
46- const [ open , setOpen ] = useState ( ! ! meta ) ;
46+ const [ open , setOpen ] = useState ( false ) ;
47+
48+ useEffect ( ( ) => {
49+ if ( meta ) {
50+ setOpen ( true ) ;
51+ }
52+ } , [ meta ] ) ;
4753
4854 return (
49- < AlertDialog open = { open } >
55+ < AlertDialog open = { open } onOpenChange = { setOpen } >
5056 < AlertDialogContent className = "text-foreground" >
5157 < AlertDialogHeader >
5258 < AlertDialogTitle className = "text-foreground" >
You can’t perform that action at this time.
0 commit comments