@@ -64,6 +64,7 @@ function adminNavigateTo(page) {
6464 adminState . currentPage = basePage ;
6565 adminState . serverId = param ? parseInt ( param , 10 ) : null ;
6666 adminState . userId = param ? parseInt ( param , 10 ) : null ;
67+ updateAdminNav ( ) ;
6768
6869 if ( basePage === 'server' && adminState . serverId ) {
6970 renderAdminServerDetail ( adminState . serverId ) ;
@@ -228,35 +229,39 @@ function renderAdminLayout() {
228229 } ) ;
229230 } ) ;
230231
231- updateAdminNav ( ) ;
232-
233232 const path = window . location . pathname . replace ( '/admin/' , '' ) . split ( '/' ) ;
234233 const basePage = path [ 0 ] || 'dashboard' ;
235234 const param = path [ 1 ] || null ;
236235 if ( basePage === 'server' && param ) {
237236 const pid = parseInt ( param , 10 ) ;
238237 adminState . currentPage = 'server' ;
238+ updateAdminNav ( ) ;
239239 adminState . serverId = pid ;
240240 $a ( '#admin-page-server-detail' ) . classList . add ( 'active' ) ;
241241 $a ( '#admin-page-servers' ) . classList . remove ( 'active' ) ;
242242 renderAdminServerDetail ( pid ) ;
243243 } else if ( basePage === 'user' && param ) {
244244 const uid = parseInt ( param , 10 ) ;
245245 adminState . currentPage = 'user' ;
246+ updateAdminNav ( ) ;
246247 adminState . userId = uid ;
247248 $a ( '#admin-page-user-detail' ) . classList . add ( 'active' ) ;
248249 renderAdminUserDetail ( uid ) ;
249250 } else if ( basePage === 'users' ) {
250251 adminState . currentPage = 'users' ;
252+ updateAdminNav ( ) ;
251253 renderAdminUsers ( ) ;
252254 } else if ( basePage === 'dashboard' || ! basePage ) {
253255 adminState . currentPage = 'dashboard' ;
256+ updateAdminNav ( ) ;
254257 renderAdminDashboard ( ) ;
255258 } else if ( basePage === 'activity' ) {
256259 adminState . currentPage = 'activity' ;
260+ updateAdminNav ( ) ;
257261 renderAdminActivity ( ) ;
258262 } else {
259263 adminState . currentPage = 'servers' ;
264+ updateAdminNav ( ) ;
260265 renderAdminServers ( ) ;
261266 }
262267}
0 commit comments