@@ -232,40 +232,45 @@ export default function Layout({ children }: PropsWithChildren) {
232232 < div ref = { versionPopoverRef } className = "relative w-fit" >
233233 < button
234234 type = "button"
235- className = { ` relative inline-flex items-center rounded-md bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold text-primary ring-1 ring-primary/10 transition-colors ${ releaseURL ? 'cursor-pointer hover:bg-primary/15' : 'cursor-default' } ` }
235+ className = " relative inline-flex cursor-pointer items-center rounded-md bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold text-primary ring-1 ring-primary/10 transition-colors hover:bg-primary/15"
236236 title = { hasUpdate && latestVersion ? t ( 'common.newVersionAvailable' , { version : latestVersion } ) : undefined }
237237 tabIndex = { sidebarCollapsed ? - 1 : 0 }
238- onClick = { ( ) => {
239- if ( ! releaseURL ) return
240- setShowVersionPopover ( ( current ) => ! current )
241- } }
238+ onClick = { ( ) => setShowVersionPopover ( ( current ) => ! current ) }
242239 >
243240 { __APP_VERSION__ }
244241 { hasUpdate && (
245242 < span className = "absolute -top-1.5 left-1/2 size-2.5 -translate-x-1/2 rounded-full bg-red-500 shadow-sm ring-2 ring-[hsl(var(--sidebar-background))] animate-pulse" />
246243 ) }
247244 </ button >
248- { showVersionPopover && releaseURL && latestVersion && (
245+ { showVersionPopover && (
249246 < div className = "absolute left-0 top-[calc(100%+8px)] z-50 w-[240px] rounded-lg border border-border bg-popover p-3 text-left shadow-xl" >
250247 < div className = "text-[13px] font-semibold text-foreground" >
251- { hasUpdate ? t ( 'common.newVersionAvailable' , { version : latestVersion } ) : t ( 'common.versionLatest' ) }
248+ { latestVersion
249+ ? hasUpdate
250+ ? t ( 'common.newVersionAvailable' , { version : latestVersion } )
251+ : t ( 'common.versionLatest' )
252+ : t ( 'common.versionChecking' ) }
252253 </ div >
253254 < div className = "mt-1 text-[11px] text-muted-foreground" >
254255 { t ( 'common.currentVersion' , { version : __APP_VERSION__ } ) }
255256 </ div >
256- < div className = "mt-1 text-[11px] text-muted-foreground" >
257- { t ( 'common.latestVersion' , { version : latestVersion } ) }
258- </ div >
259- < a
260- href = { releaseURL }
261- target = "_blank"
262- rel = "noopener noreferrer"
263- className = "mt-3 inline-flex w-full items-center justify-center gap-1.5 rounded-md border border-primary/20 bg-primary/10 px-2.5 py-1.5 text-[12px] font-semibold text-primary transition-colors hover:bg-primary/15"
264- onClick = { ( ) => setShowVersionPopover ( false ) }
265- >
266- { t ( 'common.viewReleaseNotes' ) }
267- < ExternalLink className = "size-3.5" />
268- </ a >
257+ { latestVersion && (
258+ < div className = "mt-1 text-[11px] text-muted-foreground" >
259+ { t ( 'common.latestVersion' , { version : latestVersion } ) }
260+ </ div >
261+ ) }
262+ { releaseURL && (
263+ < a
264+ href = { releaseURL }
265+ target = "_blank"
266+ rel = "noopener noreferrer"
267+ className = "mt-3 inline-flex w-full items-center justify-center gap-1.5 rounded-md border border-primary/20 bg-primary/10 px-2.5 py-1.5 text-[12px] font-semibold text-primary transition-colors hover:bg-primary/15"
268+ onClick = { ( ) => setShowVersionPopover ( false ) }
269+ >
270+ { t ( 'common.viewReleaseNotes' ) }
271+ < ExternalLink className = "size-3.5" />
272+ </ a >
273+ ) }
269274 </ div >
270275 ) }
271276 </ div >
0 commit comments