diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js index 939101d68fd212cec0a809f6ebc4f270f48f0a9f..e35a47d8dafc6e62ca93a015254b4bd81f447eec 100644 --- a/packages/app-shell/src/app-shell.js +++ b/packages/app-shell/src/app-shell.js @@ -2,7 +2,7 @@ import {createI18nInstance} from './i18n.js'; import {html, css, LitElement} from 'lit-element'; import {ScopedElementsMixin} from '@open-wc/scoped-elements'; import {LanguageSelect} from 'vpu-language-select'; -import {Icon} from 'vpu-common'; +import {Icon, EventBus} from 'vpu-common'; import {Auth} from 'vpu-auth'; import {Notification} from 'vpu-notification'; import * as commonStyles from 'vpu-common/styles'; @@ -10,7 +10,6 @@ import * as commonUtils from 'vpu-common/utils'; import buildinfo from 'consts:buildinfo'; import {classMap} from 'lit-html/directives/class-map.js'; import {Router} from './router.js'; -import * as events from 'vpu-common/events.js'; import {BuildInfo} from './build-info.js'; import {TUGrazLogo} from './tugraz-logo.js'; import {send as notify} from 'vpu-common/notification'; @@ -57,7 +56,6 @@ export class AppShell extends ScopedElementsMixin(LitElement) { this._updateAuth = this._updateAuth.bind(this); this._loginStatus = 'unknown'; - this._subscriber = new events.EventSubscriber('vpu-auth-update', 'vpu-auth-update-request'); this._attrObserver = new MutationObserver(this.onAttributeObserved); } @@ -241,15 +239,17 @@ export class AppShell extends ScopedElementsMixin(LitElement) { connectedCallback() { super.connectedCallback(); + this._bus = new EventBus(); + if (this.src) this.fetchMetadata(this.src); this.initRouter(); - this._subscriber.subscribe(this._updateAuth); + this._bus.subscribe('auth-update', this._updateAuth); } disconnectedCallback() { - this._subscriber.unsubscribe(this._updateAuth); + this._bus.close(); super.disconnectedCallback(); } diff --git a/packages/app-shell/vendor/auth b/packages/app-shell/vendor/auth index f3aa17bcca0c04055ad2835ed620146a741a107d..4594a22095b2a7a06c0f91ec0a51a0a55125b356 160000 --- a/packages/app-shell/vendor/auth +++ b/packages/app-shell/vendor/auth @@ -1 +1 @@ -Subproject commit f3aa17bcca0c04055ad2835ed620146a741a107d +Subproject commit 4594a22095b2a7a06c0f91ec0a51a0a55125b356