mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 Notebook data may be corrupted during data synchronization https://github.com/siyuan-note/siyuan/issues/9594
This commit is contained in:
parent
a721bbe6f0
commit
70c56c8e25
24 changed files with 88 additions and 96 deletions
|
|
@ -101,7 +101,7 @@ func LoadPetals(frontend string) (ret []*Petal) {
|
|||
func loadCode(petal *Petal) {
|
||||
pluginDir := filepath.Join(util.DataDir, "plugins", petal.Name)
|
||||
jsPath := filepath.Join(pluginDir, "index.js")
|
||||
if !gulu.File.IsExist(jsPath) {
|
||||
if !filelock.IsExist(jsPath) {
|
||||
logging.LogErrorf("plugin [%s] js not found", petal.Name)
|
||||
return
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ func loadCode(petal *Petal) {
|
|||
petal.JS = string(data)
|
||||
|
||||
cssPath := filepath.Join(pluginDir, "index.css")
|
||||
if gulu.File.IsExist(cssPath) {
|
||||
if filelock.IsExist(cssPath) {
|
||||
data, err = filelock.ReadFile(cssPath)
|
||||
if nil != err {
|
||||
logging.LogErrorf("read plugin [%s] css failed: %s", petal.Name, err)
|
||||
|
|
@ -204,7 +204,7 @@ func getPetals() (ret []*Petal) {
|
|||
}
|
||||
|
||||
confPath := filepath.Join(petalDir, "petals.json")
|
||||
if !gulu.File.IsExist(confPath) {
|
||||
if !filelock.IsExist(confPath) {
|
||||
data, err := gulu.JSON.MarshalIndentJSON(ret, "", "\t")
|
||||
if nil != err {
|
||||
logging.LogErrorf("marshal petals failed: %s", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue