mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-25 17:22:27 +08:00
fix(omp): hide the Oh My Pi choice when importing skills
Like Pi, Oh My Pi's skill state is whether the directory exists in its native skills folder, and the import overwrites the submitted choice with that fact. Showing the checkbox let users tick an option with no effect.
This commit is contained in:
1 parent
d9422e7d6a
commit
d01daa0d65
1 file changed
+6
-3
@@ -11,8 +11,11 @@ import { cn } from "@/lib/utils";
|
||||
import { MatrixSearch } from "@/components/mcp/AppMatrix";
|
||||
import { CHECKBOX_CLASS, V7Dialog } from "@/components/mcp/formBits";
|
||||
|
||||
/** Pi 的启用状态由 ~/.pi/agent/skills 里有没有这个目录决定,导入时不勾选 */
|
||||
const IMPORT_APP_IDS = SKILLS_APP_IDS.filter((app) => app !== "pi");
|
||||
/** Pi 与 Oh My Pi 的启用状态由各自原生 skills 目录里有没有这个目录决定,导入时不勾选 */
|
||||
const NATIVE_DIR_APPS: AppId[] = ["pi", "omp"];
|
||||
const IMPORT_APP_IDS = SKILLS_APP_IDS.filter(
|
||||
(app) => !NATIVE_DIR_APPS.includes(app),
|
||||
);
|
||||
|
||||
interface SkillImportDialogProps {
|
||||
skills: UnmanagedSkill[];
|
||||
@@ -46,7 +49,7 @@ export function SkillImportDialog({
|
||||
const set = new Set<AppId>();
|
||||
for (const skill of skills) {
|
||||
for (const found of skill.foundIn) {
|
||||
if (isAppId(found) && found !== "pi" && found !== "omp") set.add(found);
|
||||
if (isAppId(found) && !NATIVE_DIR_APPS.includes(found)) set.add(found);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
|
||||
Reference in new issue
Block a user