sort clean browsers
This commit is contained in:
@@ -220,9 +220,14 @@ async function startBrowserScan(browser: 'chrome' | 'edge') {
|
|||||||
s.cleanResult = null;
|
s.cleanResult = null;
|
||||||
try {
|
try {
|
||||||
const res = await invoke<BrowserScanResult>("start_browser_scan", { browser });
|
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 = {
|
s.scanResult = {
|
||||||
...res,
|
...res,
|
||||||
profiles: res.profiles.map(p => ({ ...p, enabled: true }))
|
profiles: sortedProfiles
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showAlert("扫描失败", String(err), 'error');
|
showAlert("扫描失败", String(err), 'error');
|
||||||
|
|||||||
Reference in New Issue
Block a user