fix(plugins): 未注册插件默认启用 + 开关直接加载(运行时启用)+ 加载成功自愈启用状态 + 全部启用按钮 + 市场请求双通道回退
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 35s

This commit is contained in:
qiqi committed 2026-11-17 16:34:16 +08:00
1 parent 06d8551107
commit 371f114d69
5 files changed
+77 -13

No files matched your search

+3 -1
View File
@@ -46,7 +46,9 @@
const H = host()
const registered = !!(H && typeof H.list === 'function' && H.list().some(function (p) { return p.id === record.id }))
record.status = registered ? 'loaded' : 'not-registered'
if (registered && typeof H.isEnabled === 'function' && H.isEnabled(record.id)) H.setEnabled(record.id, true)
// 自愈:只要脚本成功注册,就把启用状态写回 true
// (此前只在「已经启用」时写,导致状态里残留的 false 永远翻不回来,界面显示已加载但开关是关的)
if (registered) { try { H.setEnabled(record.id, true) } catch (e) { /* ignore */ } }
return record.status === 'loaded'
}