mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Fixed theme template picker state syncing with AdminX (#19328)
refs PROD-235 Special case where we need to set the old theme to inactive after activating a new theme.
This commit is contained in:
parent
95eaaad459
commit
2b85980302
1 changed files with 6 additions and 1 deletions
|
@ -179,7 +179,12 @@ export default class AdminXComponent extends Component {
|
||||||
const activated = response.themes.find(theme => theme.active);
|
const activated = response.themes.find(theme => theme.active);
|
||||||
|
|
||||||
if (activated) {
|
if (activated) {
|
||||||
this.themeManagement.activeTheme = this.store.peekAll('theme').filterBy('name', activated.name).firstObject;
|
const previouslyActive = this.store.peekAll('theme').find(theme => theme.active && theme.name !== activated.name);
|
||||||
|
previouslyActive?.set('active', false);
|
||||||
|
|
||||||
|
const newlyActive = this.store.peekAll('theme').filterBy('name', activated.name).firstObject;
|
||||||
|
newlyActive?.set('active', true);
|
||||||
|
this.themeManagement.activeTheme = newlyActive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue