Skip to content

Commit

Permalink
Restore Harvester nuxt global vars in app init (#11618)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnotv authored and nwmac committed Aug 13, 2024
1 parent 80bb6dd commit 71c0394
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions shell/initialize/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ export default {
// add to window so we can listen when ready
window.$globalApp = this;
// This is needed for Harvester https://github.com/rancher/dashboard/issues/10681
const isHarvester = this.$globalApp?.$store.getters['currentCluster']?.isHarvester;
if (!isHarvester) {
Object.defineProperty(window, '$nuxt', {
get() {
console.warn('window.$nuxt is deprecated. It would be best to stop using globalState all together. For an alternative you can use window.$globalApp.'); // eslint-disable-line no-console
return window.$globalApp;
}
});
}
this.refreshOnlineStatus();
// Setup the listeners
window.addEventListener('online', this.refreshOnlineStatus);
Expand Down

0 comments on commit 71c0394

Please sign in to comment.