@@ -40,7 +40,7 @@ function switchSection(id) {
4040
4141 /* Auto-load data for certain panels */
4242 if ( id === 'security' ) loadApiTokens ( ) ;
43- if ( id === ' backup' ) loadBackupList ( ) ;
43+ if ( target && target . querySelector ( '# backup-list' ) ) loadBackupList ( ) ;
4444 if ( id === 'themes' ) refreshRegistry ( ) ;
4545
4646 /* URL hash */
@@ -710,8 +710,9 @@ function loadBackupList() {
710710 fetch ( '/api/backup/list' )
711711 . then ( function ( r ) { return r . json ( ) ; } )
712712 . then ( function ( res ) {
713+ var backups = Array . isArray ( res ) ? res : ( res && Array . isArray ( res . backups ) ? res . backups : [ ] ) ;
713714 el . textContent = '' ;
714- if ( ! res . backups || res . backups . length === 0 ) {
715+ if ( backups . length === 0 ) {
715716 var emptySpan = document . createElement ( 'span' ) ;
716717 emptySpan . style . cssText = 'color:var(--muted);font-style:italic;' ;
717718 emptySpan . textContent = T . backup_none || 'No backups found' ;
@@ -721,9 +722,9 @@ function loadBackupList() {
721722 var table = document . createElement ( 'table' ) ;
722723 table . style . cssText = 'width:100%;border-collapse:collapse;' ;
723724 var tbody = document . createElement ( 'tbody' ) ;
724- res . backups . forEach ( function ( b ) {
725+ backups . forEach ( function ( b ) {
725726 var sizeMB = ( b . size / 1048576 ) . toFixed ( 1 ) ;
726- var date = new Date ( b . modified * 1000 ) . toLocaleString ( ) ;
727+ var date = b . modified ? new Date ( b . modified ) . toLocaleString ( ) : '' ;
727728 var tr = document . createElement ( 'tr' ) ;
728729 tr . style . cssText = 'border-bottom:1px solid var(--card-border);' ;
729730
0 commit comments