@@ -29,7 +29,15 @@ interface UpdateAppProps {
2929const UpdateApp = ( { isCheckPage } : UpdateAppProps ) => {
3030 const { t } = useTranslation ( ) ;
3131 const isDark = useThemeStore ( ( state ) => state . isDark ) ;
32- const { visible, setVisible, skipVersion, setSkipVersion, isOptional, updateInfo, setUpdateInfo } = useUpdateStore ( ) ;
32+ const {
33+ visible,
34+ setVisible,
35+ skipVersion,
36+ setSkipVersion,
37+ isOptional,
38+ updateInfo,
39+ setUpdateInfo,
40+ } = useUpdateStore ( ) ;
3341 const addError = useAppStore ( ( state ) => state . addError ) ;
3442 const snapshotUpdate = useAppearanceStore ( ( state ) => state . snapshotUpdate ) ;
3543
@@ -125,44 +133,73 @@ const UpdateApp = ({ isCheckPage }: UpdateAppProps) => {
125133 className = "relative z-10 focus:outline-none"
126134 onClose = { noop }
127135 >
128- < div className = { `fixed inset-0 z-10 w-screen overflow-y-auto ${ isCheckPage ? "rounded-lg bg-white dark:bg-[#333] border border-[#EDEDED] dark:border-black/20 shadow-md" : "" } ` } >
129- < div className = { clsx ( "flex min-h-full items-center justify-center" , ! isCheckPage && "p-4" ) } >
136+ < div
137+ className = { `fixed inset-0 z-10 w-screen overflow-y-auto ${
138+ isCheckPage
139+ ? "rounded-lg bg-white dark:bg-[#333] border border-[#EDEDED] dark:border-black/20 shadow-md"
140+ : ""
141+ } `}
142+ >
143+ < div
144+ className = { clsx (
145+ "flex min-h-full items-center justify-center" ,
146+ ! isCheckPage && "p-4"
147+ ) }
148+ >
130149 < DialogPanel
131150 transition
132- className = { `relative w-[340px] py-8 flex flex-col items-center ${ isCheckPage ? "" : "rounded-lg bg-white dark:bg-[#333] border border-[#EDEDED] dark:border-black/20 shadow-md" } ` }
151+ className = { `relative w-[340px] py-8 flex flex-col items-center ${
152+ isCheckPage
153+ ? ""
154+ : "rounded-lg bg-white dark:bg-[#333] border border-[#EDEDED] dark:border-black/20 shadow-md"
155+ } `}
133156 >
134157 { ! isCheckPage && isOptional && (
135158 < X
136- className = { clsx ( "absolute size-5 top-3 right-3 text-[#999] dark:text-[#D8D8D8]" , cursorClassName ) }
159+ className = { clsx (
160+ "absolute size-5 top-3 right-3 text-[#999] dark:text-[#D8D8D8]" ,
161+ cursorClassName
162+ ) }
137163 onClick = { handleCancel }
164+ role = "button"
165+ aria-label = "Close dialog"
166+ tabIndex = { 0 }
138167 />
139168 ) }
140169
141170 < img src = { isDark ? darkIcon : lightIcon } className = "h-6" />
142171
143172 < div className = "text-[#333] text-sm leading-5 py-2 dark:text-[#D8D8D8] text-center" >
144173 { updateInfo ?. available ? (
145- isOptional ? t ( "update.optional_description" ) : (
174+ isOptional ? (
175+ t ( "update.optional_description" )
176+ ) : (
146177 < >
147178 < p > { t ( "update.force_description1" ) } </ p >
148179 < p > { t ( "update.force_description2" ) } </ p >
149180 </ >
150181 )
151- ) : t ( "update.date" ) }
182+ ) : (
183+ t ( "update.date" )
184+ ) }
152185 </ div >
153186
154187 { updateInfo ?. available ? (
155188 < div
156189 className = "text-xs text-[#0072FF] cursor-pointer"
157190 onClick = { ( ) =>
158- OpenURLWithBrowser ( "https://docs.infinilabs.com/coco-app/main/docs/release-notes" )
191+ OpenURLWithBrowser (
192+ "https://docs.infinilabs.com/coco-app/main/docs/release-notes"
193+ )
159194 }
160195 >
161196 v{ updateInfo . version } { t ( "update.releaseNotes" ) }
162197 </ div >
163198 ) : (
164199 < div className = { clsx ( "text-xs text-[#999]" , cursorClassName ) } >
165- { t ( "update.latest" , { replace : [ updateInfo ?. version || "v0.6.0" ] } ) }
200+ { t ( "update.latest" , {
201+ replace : [ updateInfo ?. version || process . env . VERSION || "N/A" ] ,
202+ } ) }
166203 </ div >
167204 ) }
168205
@@ -179,7 +216,11 @@ const UpdateApp = ({ isCheckPage }: UpdateAppProps) => {
179216 < LoaderCircle className = "animate-spin size-5" />
180217 { percent } %
181218 </ div >
182- ) : updateInfo ?. available ? t ( "update.button.install" ) : t ( "update.button.ok" ) }
219+ ) : updateInfo ?. available ? (
220+ t ( "update.button.install" )
221+ ) : (
222+ t ( "update.button.ok" )
223+ ) }
183224 </ Button >
184225
185226 { updateInfo ?. available && isOptional && (
@@ -194,7 +235,6 @@ const UpdateApp = ({ isCheckPage }: UpdateAppProps) => {
194235 </ div >
195236 </ div >
196237 </ Dialog >
197-
198238 ) ;
199239} ;
200240
0 commit comments