fix(StorageCleaner): 同一标签页 URL 变更时阻止误清理

handleClean 原先仅校验 tab id,未校验 url。用户在页面内导航后、
存储信息刷新完成前确认清理,会按旧页面展示的数据清理新页面存储。
This commit is contained in:
Cursor Agent
2026-06-27 11:03:39 +00:00
parent 2967a6f79f
commit 3f2b2585b8
2 changed files with 30 additions and 3 deletions
@@ -258,8 +258,8 @@ export function useStorageCleaner(): UseStorageCleanerReturn {
}
const boundTab = boundTabRef.current;
if (!boundTab || boundTab.id !== tab.id) {
toast.warning('当前标签页已切换,请等待数据刷新后再清理');
if (!boundTab || boundTab.id !== tab.id || boundTab.url !== tab.url) {
toast.warning('当前页面已变更,请等待数据刷新后再清理');
setShowConfirm(false);
return;
}