优化颜色过滤逻辑,将变量声明从let改为const,以提高代码可读性和一致性。

This commit is contained in:
Zylan
2025-04-25 12:37:40 +08:00
parent c722253b04
commit e247cbef2b

View File

@@ -170,7 +170,7 @@ export default function Home() {
}
const selectedKeys = selectedOption.keys;
const keySet = new Set(selectedKeys);
let filteredPalette = fullBeadPalette.filter(color => keySet.has(color.key));
const filteredPalette = fullBeadPalette.filter(color => keySet.has(color.key));
const t1Color = fullBeadPalette.find(p => p.key === 'T1');
if (t1Color && !keySet.has('T1')) {
if (!filteredPalette.some(p => p.key === 'T1')) {