@seamly/web-ui 21.0.2-beta.1 → 21.0.2-beta.4

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.
@@ -7257,7 +7257,7 @@ class API {
7257
7257
  (_a = this.conversation) === null || _a === void 0 ? void 0 : _a.onConnection(connectionState => {
7258
7258
  const connected = connectionState === 'join_channel_succeeded';
7259
7259
  const ready = connectionState === 'attach_channel_succeeded';
7260
- if (waitForReady ? ready : connected || ready) {
7260
+ if (connected || ready) {
7261
7261
  this.send(command, payload, waitForReady);
7262
7262
  }
7263
7263
  });
@@ -7355,7 +7355,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_layoutMode = n
7355
7355
  return {
7356
7356
  clientName: "@seamly/web-ui",
7357
7357
  clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
7358
- clientVersion: "21.0.2-beta.1",
7358
+ clientVersion: "21.0.2-beta.4",
7359
7359
  currentUrl: window.location.toString(),
7360
7360
  screenResolution: `${window.screen.width}x${window.screen.height}`,
7361
7361
  timezone: getTimeZone(),
@@ -21972,7 +21972,19 @@ class ExternalApi {
21972
21972
  }
21973
21973
  });
21974
21974
  }
21975
+ instanceInitializing(namespace) {
21976
+ const instances = Object.keys(this._instances);
21977
+ return !namespace && instances.length > 0 || instances.includes(namespace);
21978
+ }
21975
21979
  setContext(action, args) {
21980
+ const {
21981
+ instance: namespace
21982
+ } = args;
21983
+ // Do not set this action in context if we are already initializing.
21984
+ // If we do, it will not be sent to the server anymore (because it gets marked as 'handled').
21985
+ if (this.instanceInitializing(namespace)) {
21986
+ return false;
21987
+ }
21976
21988
  switch (action) {
21977
21989
  case 'setTopic':
21978
21990
  const {
@@ -22041,9 +22053,7 @@ class ExternalApi {
22041
22053
 
22042
22054
  // results will be an array containing the results of wether an instance has
22043
22055
  // handled the action or not
22044
- const results = instances.map(instance => {
22045
- return !namespace || instance.namespace === namespace ? instance.execFunction(action, ...args) : false;
22046
- });
22056
+ const results = instances.map(instance => !namespace || instance.namespace === namespace ? instance.execFunction(action, ...args) : false);
22047
22057
 
22048
22058
  // test if any of the instances has handled the action
22049
22059
  return results.some(Boolean);