0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Revert back to use did-insert hook

This commit is contained in:
Aileen Nowak 2023-03-22 13:40:21 +00:00 committed by Aileen Booker
parent d2ab69aeb6
commit 00db25e314
2 changed files with 11 additions and 0 deletions

View file

@ -4,5 +4,6 @@
frameborder="0"
title="Explore"
{{did-update this.handleDarkModeChange this.feature.nightShift}}
{{did-insert this.setup}}
...attributes
></iframe>

View file

@ -17,6 +17,16 @@ export default class GhExploreIframe extends Component {
window.removeEventListener('message', this.handleIframeMessage);
}
@action
setup() {
// Only begin setup when Explore window is toggled open
// to avoid unnecessary loading of assets
if (this.explore.exploreWindowOpen) {
console.log('Rebuild');
this.explore.getExploreIframe().src = this.explore.getIframeURL();
}
}
@action
async handleIframeMessage(event) {
if (this.isDestroyed || this.isDestroying) {