Skip to content

Commit b5a9d1e

Browse files
committed
恢复 is_default_folder/is_editable 方法及 enter() 方法(重写遗漏的部分)
1 parent e562d03 commit b5a9d1e

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

phira/src/page/favorites.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,19 @@ impl FavoritesPage {
178178
}
179179
}
180180

181+
// 默认收藏夹仅可修改封面 || The default favorites folder can only modify the cover
182+
fn is_default_folder(folder_name: &Option<String>) -> bool {
183+
matches!(folder_name, Some(name) if name == DEFAULT_FAVORITES_KEY)
184+
}
185+
186+
// 自定义收藏夹可编辑(重命名、删除、修改封面) || Custom favorites folders can be edited (rename, delete, modify cover)
187+
fn is_editable(folder_name: &Option<String>) -> bool {
188+
match folder_name {
189+
None => false,
190+
Some(name) => name != DEFAULT_FAVORITES_KEY,
191+
}
192+
}
193+
181194
fn has_menu(folder_name: &Option<String>) -> bool {
182195
folder_name.is_some()
183196
}

phira/src/page/library.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ impl Page for LibraryPage {
285285
tl!("label")
286286
}
287287

288+
fn enter(&mut self, _s: &mut SharedState) -> Result<()> {
289+
Ok(())
290+
}
291+
288292
fn on_result(&mut self, res: Box<dyn Any>, s: &mut SharedState) -> Result<()> {
289293
let _res = match res.downcast::<bool>() {
290294
Err(res) => res,

0 commit comments

Comments
 (0)