fix(plugins): 未注册插件默认启用 + 开关直接加载(运行时启用)+ 加载成功自愈启用状态 + 全部启用按钮 + 市场请求双通道回退
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 35s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 35s
This commit is contained in:
1 parent
06d8551107
commit
371f114d69
5 files changed
+77
-13
No files matched your search
+5
-2
@@ -229,8 +229,11 @@
|
||||
|
||||
function isEnabled(id) {
|
||||
if (plugins.has(id)) return Boolean(recordOf(id).enabled)
|
||||
// 未注册:直接读持久化开关(不得走 recordOf——那会为陌生 id 创建 state 条目)
|
||||
return Boolean(state[id] && state[id].enabled)
|
||||
// 未注册:有持久化记录就按记录;**没有记录 ⇒ 默认启用**
|
||||
// (否则启动早期 state 还没读到时,所有插件都会被判成「已停用」而进 idle)
|
||||
const rec = state[id]
|
||||
if (!rec) return true
|
||||
return Boolean(rec.enabled)
|
||||
}
|
||||
|
||||
function init(nextDeps) {
|
||||
|
||||
Reference in new issue
Block a user