Skip to content

Commit

Permalink
Subscribe to app updater$
Browse files Browse the repository at this point in the history
  • Loading branch information
poffdeluxe committed Mar 25, 2020
1 parent 6431b3f commit 49db2e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/legacy/ui/public/new_platform/new_platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@ export const legacyAppRegister = (app: App<any>) => {
),
onAppLeave: () => undefined,
};

if (app.updater$) {
app.updater$.subscribe(updater => {
const updatedFields = updater(app);
if (updatedFields && updatedFields.activeUrl) {
npStart.core.chrome.navLinks.update(app.id, {
url: updatedFields.activeUrl,
});
}
});
}

const unmount = isAppMountDeprecated(app.mount)
? await app.mount({ core: npStart.core }, params)
: await app.mount(params);
Expand Down

0 comments on commit 49db2e5

Please sign in to comment.