🎨 Support one-click enable/disable of all downloaded plugins https://github.com/siyuan-note/siyuan/issues/8523

This commit is contained in:
Daniel 2023-06-23 21:59:47 +08:00
parent d54195a943
commit 5d4ac05269
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -44,7 +44,7 @@ type PetalConf struct {
Enabled bool `json:"enabled"`
}
func (conf *PetalConf) Save() {
func (pConf *PetalConf) Save() {
if util.ReadOnly {
return
}
@ -52,11 +52,10 @@ func (conf *PetalConf) Save() {
petalsStoreLock.Lock()
defer petalsStoreLock.Unlock()
data, _ := gulu.JSON.MarshalIndentJSON(Conf, "", " ")
data, _ := gulu.JSON.MarshalIndentJSON(pConf, "", " ")
petalDir := filepath.Join(util.DataDir, "storage", "petal")
if err := os.MkdirAll(petalDir, 0777); nil != err {
logging.LogErrorf("create petal dir [%s] failed: %s", petalDir, err)
util.ReportFileSysFatalError(err)
return
}