FIX: Detect installed themes using URLs instead of names (#12201)

Context: https://meta.discourse.org/t/not-all-installed-theme-components-listed-as-installed/179756?u=osama
This commit is contained in:
Osama Sayegh
2021-02-25 00:10:17 +03:00
committed by GitHub
parent 7c45ff6659
commit a6850d9691
4 changed files with 44 additions and 5 deletions

View File

@@ -15,8 +15,8 @@ export default Controller.extend({
return themes.filter((t) => t.get("component"));
},
@discourseComputed("model", "model.@each.component")
installedThemes(themes) {
return themes.map((t) => t.name);
@discourseComputed("model.content")
installedThemes(content) {
return content || [];
},
});

View File

@@ -44,7 +44,9 @@ export default Controller.extend(ModalFunctionality, {
@discourseComputed("themesController.installedThemes")
themes(installedThemes) {
return POPULAR_THEMES.map((t) => {
if (installedThemes.includes(t.name)) {
if (
installedThemes.some((theme) => this.themeHasSameUrl(theme, t.value))
) {
set(t, "installed", true);
}
return t;