mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-11 23:22:33 +01:00
🎨 Unified file listener logic (#17134)
This commit is contained in:
parent
ba733eedfd
commit
26c378a820
10 changed files with 462 additions and 191 deletions
|
|
@ -432,7 +432,7 @@ func InstalledThemes(keyword string) (ret []*bazaar.Theme) {
|
|||
}
|
||||
|
||||
func InstallBazaarTheme(repoURL, repoHash, themeName string, mode int, update bool) error {
|
||||
closeThemeWatchers()
|
||||
CloseWatchThemes()
|
||||
|
||||
installPath := filepath.Join(util.ThemesPath, themeName)
|
||||
err := bazaar.InstallTheme(repoURL, repoHash, installPath, Conf.System.ID)
|
||||
|
|
@ -458,7 +458,7 @@ func InstallBazaarTheme(repoURL, repoHash, themeName string, mode int, update bo
|
|||
}
|
||||
|
||||
func UninstallBazaarTheme(themeName string) error {
|
||||
closeThemeWatchers()
|
||||
CloseWatchThemes()
|
||||
|
||||
installPath := filepath.Join(util.ThemesPath, themeName)
|
||||
err := bazaar.UninstallTheme(installPath)
|
||||
|
|
@ -580,3 +580,8 @@ func getSearchKeywords(query string) (ret []string) {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
// isBuiltInTheme 通过包名或目录名判断是否为内置主题
|
||||
func isBuiltInTheme(name string) bool {
|
||||
return "daylight" == name || "midnight" == name
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue