@etsoo/appscript 1.5.35 → 1.5.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -643,8 +643,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
643
643
  /**
644
644
  * Update embedded status
645
645
  * @param embedded New embedded status
646
+ * @param isWeb Is web or not
646
647
  */
647
- updateEmbedded(embedded?: boolean): void;
648
+ updateEmbedded(embedded: boolean | undefined | null, isWeb?: boolean): void;
648
649
  /**
649
650
  * User login
650
651
  * @param user User data
@@ -1599,14 +1599,20 @@ class CoreApp {
1599
1599
  /**
1600
1600
  * Update embedded status
1601
1601
  * @param embedded New embedded status
1602
+ * @param isWeb Is web or not
1602
1603
  */
1603
- updateEmbedded(embedded) {
1604
+ updateEmbedded(embedded, isWeb) {
1604
1605
  // Check current session when it's undefined
1605
1606
  if (embedded == null) {
1606
1607
  embedded = this.storage.getData(this.fields.embedded);
1607
1608
  if (embedded == null)
1608
1609
  return;
1609
1610
  }
1611
+ // Is web way?
1612
+ // Pass the true embedded status from parent to child (Both conditions are true)
1613
+ if (isWeb && embedded && globalThis.self !== globalThis.parent) {
1614
+ embedded = false;
1615
+ }
1610
1616
  // Ignore the same value
1611
1617
  if (embedded === this._embedded)
1612
1618
  return;
@@ -643,8 +643,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
643
643
  /**
644
644
  * Update embedded status
645
645
  * @param embedded New embedded status
646
+ * @param isWeb Is web or not
646
647
  */
647
- updateEmbedded(embedded?: boolean): void;
648
+ updateEmbedded(embedded: boolean | undefined | null, isWeb?: boolean): void;
648
649
  /**
649
650
  * User login
650
651
  * @param user User data
@@ -1596,14 +1596,20 @@ export class CoreApp {
1596
1596
  /**
1597
1597
  * Update embedded status
1598
1598
  * @param embedded New embedded status
1599
+ * @param isWeb Is web or not
1599
1600
  */
1600
- updateEmbedded(embedded) {
1601
+ updateEmbedded(embedded, isWeb) {
1601
1602
  // Check current session when it's undefined
1602
1603
  if (embedded == null) {
1603
1604
  embedded = this.storage.getData(this.fields.embedded);
1604
1605
  if (embedded == null)
1605
1606
  return;
1606
1607
  }
1608
+ // Is web way?
1609
+ // Pass the true embedded status from parent to child (Both conditions are true)
1610
+ if (isWeb && embedded && globalThis.self !== globalThis.parent) {
1611
+ embedded = false;
1612
+ }
1607
1613
  // Ignore the same value
1608
1614
  if (embedded === this._embedded)
1609
1615
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.35",
3
+ "version": "1.5.36",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -2187,14 +2187,21 @@ export abstract class CoreApp<
2187
2187
  /**
2188
2188
  * Update embedded status
2189
2189
  * @param embedded New embedded status
2190
+ * @param isWeb Is web or not
2190
2191
  */
2191
- updateEmbedded(embedded?: boolean) {
2192
+ updateEmbedded(embedded: boolean | undefined | null, isWeb?: boolean) {
2192
2193
  // Check current session when it's undefined
2193
2194
  if (embedded == null) {
2194
2195
  embedded = this.storage.getData<boolean>(this.fields.embedded);
2195
2196
  if (embedded == null) return;
2196
2197
  }
2197
2198
 
2199
+ // Is web way?
2200
+ // Pass the true embedded status from parent to child (Both conditions are true)
2201
+ if (isWeb && embedded && globalThis.self !== globalThis.parent) {
2202
+ embedded = false;
2203
+ }
2204
+
2198
2205
  // Ignore the same value
2199
2206
  if (embedded === this._embedded) return;
2200
2207