From 9ae9ccc5585ddb8cda422d67db61cccf6bd59614 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle <patrizio@bekerle.com> Date: Tue, 12 Jan 2021 07:55:55 +0100 Subject: [PATCH] Only add entry-point-url and lang attributes if they aren't subscribed (dbp/apps/library#77) --- packages/app-shell/src/app-shell.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js index 2118c946..68235e60 100644 --- a/packages/app-shell/src/app-shell.js +++ b/packages/app-shell/src/app-shell.js @@ -726,14 +726,22 @@ export class AppShell extends ScopedElementsMixin(AdapterLitElement) { return html``; const elm = this._createActivityElement(act); - elm.setAttribute("entry-point-url", this.entryPointUrl); - elm.setAttribute("lang", this.lang); - // add subscriptions to the provider component + // add subscriptions for the provider component if (act.subscribe !== undefined) { elm.setAttribute("subscribe", act.subscribe); } + // only add the entry-point-url attribute if it isn't subscribed + if (act.subscribe === undefined || !act.subscribe.includes("entry-point-url:")) { + elm.setAttribute("entry-point-url", this.entryPointUrl); + } + + // only add the lang attribute if it isn't subscribed + if (act.subscribe === undefined || !act.subscribe.includes("lang:")) { + elm.setAttribute("lang", this.lang); + } + return elm; } -- GitLab