mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 14:43:08 +03: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
@ -179,7 +179,12 @@ export default class AdminXComponent extends Component {
|
||||
const activated = response.themes.find(theme => theme.active);
|
||||
|
||||
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 New Issue
Block a user