sort clean browsers

This commit is contained in:
Julian Freeman
2026-03-03 17:29:02 -04:00
parent 33a1dfa27b
commit 6a61e36c21

View File

@@ -220,9 +220,14 @@ async function startBrowserScan(browser: 'chrome' | 'edge') {
s.cleanResult = null;
try {
const res = await invoke<BrowserScanResult>("start_browser_scan", { browser });
// 对 profiles 进行排序:按 cache_size 从大到小
const sortedProfiles = res.profiles
.map(p => ({ ...p, enabled: true }))
.sort((a, b) => b.cache_size - a.cache_size);
s.scanResult = {
...res,
profiles: res.profiles.map(p => ({ ...p, enabled: true }))
profiles: sortedProfiles
};
} catch (err) {
showAlert("扫描失败", String(err), 'error');