diff --git a/xian_favor/api.py b/xian_favor/api.py index 0e16cd6..914dfe3 100644 --- a/xian_favor/api.py +++ b/xian_favor/api.py @@ -1362,9 +1362,15 @@ document.addEventListener('DOMContentLoaded', async () => { }); // 侧边栏过滤 - document.querySelectorAll('.sidebar a').forEach(a => { + document.querySelectorAll('.sidebar a[data-filter]').forEach(a => { a.addEventListener('click', (e) => { e.preventDefault(); + + // 如果在回收站视图,先退出 + if (trashView) { + trashView = false; + } + document.querySelectorAll('.sidebar a').forEach(x => x.classList.remove('active')); a.classList.add('active');