Skip to content

Commit

Permalink
Fix issue with onEnter for package
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Apr 14, 2024
1 parent b5adf74 commit 749c736
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions shell/middleware/authenticated.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,6 @@ export default async function({
if (pkg && (oldPkg !== pkg || from.fullPath === route.fullPath)) {
// Execute mandatory store actions
await Promise.all(always);

// Execute anything optional the plugin wants to
await newPkgPlugin.onEnter(store, {
clusterId,
product,
oldProduct,
oldIsExt: !!oldPkg
});
}

if (!route.matched?.length) {
Expand Down Expand Up @@ -355,6 +347,17 @@ export default async function({
})
]);

// Init the package only after we have loaded the cluster store
if (pkg && (oldPkg !== pkg || from.fullPath === route.fullPath)) {
// Execute anything optional the plugin wants to
await newPkgPlugin.onEnter(store, {
clusterId,
product,
oldProduct,
oldIsExt: !!oldPkg
});
}

if (localCheckResource) {
const redirected = invalidResource(store, route, redirect);

Expand Down

0 comments on commit 749c736

Please sign in to comment.