File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,6 +179,13 @@ async function updateCategoryCounts() {
179179 allNavItem . textContent = currentPrompts . length . toString ( ) ;
180180 }
181181
182+ // 更新"精选"分类的计数(置顶的提示词)
183+ const featuredCount = currentPrompts . filter ( prompt => prompt . pinned ) . length ;
184+ const featuredNavItem = document . querySelector ( '[data-category="featured"] .count' ) ;
185+ if ( featuredNavItem ) {
186+ featuredNavItem . textContent = featuredCount . toString ( ) ;
187+ }
188+
182189 // 更新现有分类的计数
183190 const allNavItems = document . querySelectorAll ( '.nav-item[data-category]' ) ;
184191 allNavItems . forEach ( item => {
@@ -202,6 +209,13 @@ async function updateCategoryCounts() {
202209 if ( allNavItem ) {
203210 allNavItem . textContent = currentPrompts . length . toString ( ) ;
204211 }
212+
213+ // 同时更新"精选"分类
214+ const featuredCount = currentPrompts . filter ( prompt => prompt . pinned ) . length ;
215+ const featuredNavItem = document . querySelector ( '[data-category="featured"] .count' ) ;
216+ if ( featuredNavItem ) {
217+ featuredNavItem . textContent = featuredCount . toString ( ) ;
218+ }
205219 }
206220}
207221
You can’t perform that action at this time.
0 commit comments