diff --git a/shell/initialize/App.js b/shell/initialize/App.js index b3593d0c042..b3492435479 100644 --- a/shell/initialize/App.js +++ b/shell/initialize/App.js @@ -30,8 +30,6 @@ export default { isOnline: true, showErrorPage: false, - - nbFetching: 0 }), beforeCreate() { @@ -65,10 +63,6 @@ export default { isOffline() { return !this.isOnline; }, - - isFetching() { - return this.nbFetching > 0; - }, }, methods: { diff --git a/shell/initialize/client.js b/shell/initialize/client.js index f91bde107ca..bfb07c32002 100644 --- a/shell/initialize/client.js +++ b/shell/initialize/client.js @@ -30,10 +30,7 @@ const isDev = process.env.dev; const debug = isDev; // Fetch mixin -if (!Vue.__nuxt__fetch__mixin__) { - Vue.mixin(fetchMixin); - Vue.__nuxt__fetch__mixin__ = true; -} +Vue.mixin(fetchMixin); // Component: Vue.component(NuxtLink.name, NuxtLink); @@ -173,7 +170,6 @@ async function loadAsyncComponents(to, from, next) { } this.error({ statusCode, message }); - this.$nuxt.$emit('routeChanged', to, from, err); next(); } } @@ -444,15 +440,11 @@ async function render(to, from, next) { } catch (err) { const error = err || {}; - if (error.message === 'ERR_REDIRECT') { - return this.$nuxt.$emit('routeChanged', to, from, error); - } _lastPaths = []; globalHandleError(error); this.error(error); - this.$nuxt.$emit('routeChanged', to, from, error); next(); } } @@ -527,11 +519,6 @@ function nuxtReady(_app) { if (typeof window._onNuxtLoaded === 'function') { window._onNuxtLoaded(_app); } - // Add router hooks - router.afterEach((to, from) => { - // Wait for fixPrepatch + $data updates - Vue.nextTick(() => _app.$nuxt.$emit('routeChanged', to, from)); - }); } const noopData = () => { diff --git a/shell/mixins/fetch.client.js b/shell/mixins/fetch.client.js index 60524a8654e..38306991643 100644 --- a/shell/mixins/fetch.client.js +++ b/shell/mixins/fetch.client.js @@ -65,7 +65,6 @@ function $fetch() { } async function $_fetch() { // eslint-disable-line camelcase - this.$nuxt.nbFetching++; this.$fetchState.pending = true; this.$fetchState.error = null; this._hydrated = false; @@ -90,6 +89,4 @@ async function $_fetch() { // eslint-disable-line camelcase this.$fetchState.error = error; this.$fetchState.pending = false; this.$fetchState.timestamp = Date.now(); - - this.$nextTick(() => this.$nuxt.nbFetching--); }