mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-12 23:46:13 +01:00
♻️ Remove bazaar cache clear on appearance language change (#17160)
This commit is contained in:
parent
c564905afa
commit
465755e184
2 changed files with 0 additions and 12 deletions
|
|
@ -23,7 +23,6 @@ import (
|
|||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/bazaar"
|
||||
"github.com/siyuan-note/siyuan/kernel/conf"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/server/proxy"
|
||||
|
|
@ -554,16 +553,10 @@ func setAppearance(c *gin.Context) {
|
|||
model.Conf.Appearance = appearance
|
||||
util.StatusBarCfg = model.Conf.Appearance.StatusBar
|
||||
model.Conf.Lang = appearance.Lang
|
||||
oldLang := util.Lang
|
||||
util.Lang = model.Conf.Lang
|
||||
model.Conf.Save()
|
||||
model.InitAppearance()
|
||||
|
||||
if oldLang != util.Lang {
|
||||
// The marketplace language does not change after switching the appearance language https://github.com/siyuan-note/siyuan/issues/12892
|
||||
bazaar.CleanBazaarPackageCache()
|
||||
}
|
||||
|
||||
ret.Data = model.Conf.Appearance
|
||||
util.BroadcastByType("main", "setAppearance", 0, "", model.Conf.Appearance)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,11 +35,6 @@ import (
|
|||
// packageInstallSizeCache 缓存集市包的安装大小,与 cachedStageIndex 使用相同的缓存时间
|
||||
var packageInstallSizeCache = gcache.New(time.Duration(util.RhyCacheDuration)*time.Second, time.Duration(util.RhyCacheDuration)*time.Second/6) // [repoURL]*int64
|
||||
|
||||
// CleanBazaarPackageCache 清空集市包相关缓存(如切换语言后需刷新展示名等)
|
||||
func CleanBazaarPackageCache() {
|
||||
packageInstallSizeCache.Flush()
|
||||
}
|
||||
|
||||
// ReadInstalledPackageDirs 读取本地集市包的目录列表
|
||||
func ReadInstalledPackageDirs(basePath string) ([]os.DirEntry, error) {
|
||||
if !util.IsPathRegularDirOrSymlinkDir(basePath) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue