mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-04-25 20:40:28 -05:00
🎨 Remove petal id
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
@@ -32,7 +30,6 @@ import (
|
||||
|
||||
// Petal represents a plugin's management status.
|
||||
type Petal struct {
|
||||
ID string `json:"id"` // Plugin ID
|
||||
Name string `json:"name"` // Plugin name
|
||||
Enabled bool `json:"enabled"` // Whether enabled
|
||||
|
||||
@@ -60,7 +57,6 @@ func SetPetalEnabled(name string, enabled bool) {
|
||||
petal := getPetalByName(plugin.Name, petals)
|
||||
if nil == petal {
|
||||
petal = &Petal{
|
||||
ID: hash(plugin.Name),
|
||||
Name: plugin.Name,
|
||||
Enabled: enabled,
|
||||
}
|
||||
@@ -220,7 +216,3 @@ func getPetalByName(name string, petals []*Petal) (ret *Petal) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func hash(str string) string {
|
||||
return fmt.Sprintf("%x", sha1.Sum([]byte(str)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user