This commit is contained in:
Liang Ding 2023-05-05 23:07:06 +08:00
parent f5f5a1d428
commit 9e1dbd9b96
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
8 changed files with 129 additions and 159 deletions

View file

@ -116,7 +116,7 @@ func loadThemes() {
continue
}
modes := themeConf["modes"].([]interface{})
modes := themeConf.Modes
for _, mode := range modes {
if "dark" == mode {
Conf.Appearance.DarkThemes = append(Conf.Appearance.DarkThemes, name)
@ -127,12 +127,12 @@ func loadThemes() {
if 0 == Conf.Appearance.Mode {
if Conf.Appearance.ThemeLight == name {
Conf.Appearance.ThemeVer = themeConf["version"].(string)
Conf.Appearance.ThemeVer = themeConf.Version
Conf.Appearance.ThemeJS = gulu.File.IsExist(filepath.Join(util.ThemesPath, name, "theme.js"))
}
} else {
if Conf.Appearance.ThemeDark == name {
Conf.Appearance.ThemeVer = themeConf["version"].(string)
Conf.Appearance.ThemeVer = themeConf.Version
Conf.Appearance.ThemeJS = gulu.File.IsExist(filepath.Join(util.ThemesPath, name, "theme.js"))
}
}
@ -161,7 +161,7 @@ func loadIcons() {
}
Conf.Appearance.Icons = append(Conf.Appearance.Icons, name)
if Conf.Appearance.Icon == name {
Conf.Appearance.IconVer = iconConf["version"].(string)
Conf.Appearance.IconVer = iconConf.Version
}
}
}

View file

@ -39,7 +39,7 @@ func BazaarPlugins() (plugins []*bazaar.Plugin) {
if plugin.Installed {
if plugin.Installed {
if pluginConf, err := bazaar.PluginJSON(plugin.Name); nil == err && nil != plugin {
if plugin.Version != pluginConf["version"].(string) {
if plugin.Version != pluginConf.Version {
plugin.Outdated = true
}
}
@ -79,7 +79,7 @@ func BazaarWidgets() (widgets []*bazaar.Widget) {
if widget.Installed {
if widget.Installed {
if widgetConf, err := bazaar.WidgetJSON(widget.Name); nil == err && nil != widget {
if widget.Version != widgetConf["version"].(string) {
if widget.Version != widgetConf.Version {
widget.Outdated = true
}
}
@ -119,7 +119,7 @@ func BazaarIcons() (icons []*bazaar.Icon) {
if installed == icon.Name {
icon.Installed = true
if themeConf, err := bazaar.IconJSON(icon.Name); nil == err {
if icon.Version != themeConf["version"].(string) {
if icon.Version != themeConf.Version {
icon.Outdated = true
}
}
@ -170,7 +170,7 @@ func BazaarThemes() (ret []*bazaar.Theme) {
if installed == theme.Name {
theme.Installed = true
if themeConf, err := bazaar.ThemeJSON(theme.Name); nil == err {
theme.Outdated = theme.Version != themeConf["version"].(string)
theme.Outdated = theme.Version != themeConf.Version
}
theme.Current = theme.Name == Conf.Appearance.ThemeDark || theme.Name == Conf.Appearance.ThemeLight
}
@ -231,7 +231,7 @@ func BazaarTemplates() (templates []*bazaar.Template) {
template.Installed = gulu.File.IsExist(filepath.Join(util.DataDir, "templates", template.Name))
if template.Installed {
if themeConf, err := bazaar.TemplateJSON(template.Name); nil == err && nil != themeConf {
if template.Version != themeConf["version"].(string) {
if template.Version != themeConf.Version {
template.Outdated = true
}
}