@senior-gestao-empresarial/angular-components 4.22.0-5b65c0a7-384a-4f22-b4d9-413308f621ab → 4.22.1-706afb94-1b58-4cb7-9006-8d9033881f51

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.
@@ -6422,7 +6422,7 @@ var WebsocketService = /** @class */ (function () {
6422
6422
  WebsocketService_1 = WebsocketService;
6423
6423
  /**
6424
6424
  * Observable responsável por emitir uma notificação quando a conexão websocket é estabelecida.
6425
- * @return Um `Observable<void>` que emite uma notificação quando a conexão websocket é estabelecida ou já está em andamento.
6425
+ * @return Um `Observable<void>` que emite uma notificação quando a conexão websocket é estabelecida.
6426
6426
  */
6427
6427
  WebsocketService.prototype.onConnect = function () {
6428
6428
  var _this = this;
@@ -6446,20 +6446,20 @@ var WebsocketService = /** @class */ (function () {
6446
6446
  * @param domain Dominio da primitva.
6447
6447
  * @param service Service da primitiva.
6448
6448
  * @param primitive Primitiva que será "observada" pelo client.
6449
- * @param identifierPath Caminho até a propriedade considerada o indentificador do registro.
6449
+ * @param identifierPath Caminho até a propriedade considerada o identificador do registro.
6450
6450
  * @return Um `observable` que emite notificações toda vez que o respectivo evento é publicado no sistema.
6451
6451
  */
6452
6452
  WebsocketService.prototype.onEvent = function (domain, service, primitive, identifierPath) {
6453
6453
  var _this = this;
6454
- var primitiveManager = this.primitiveManagers.get(primitive);
6455
- if (primitiveManager) {
6456
- return primitiveManager.subject.asObservable();
6454
+ if (this.primitiveManagers.has(primitive)) {
6455
+ return this.primitiveManagers.get(primitive).subject.asObservable();
6457
6456
  }
6458
- primitiveManager = {
6457
+ var primitiveManager = {
6459
6458
  subject: new Subject(),
6460
6459
  identifierPath: identifierPath,
6461
6460
  publishedEvents: [],
6462
6461
  };
6462
+ this.primitiveManagers.set(primitive, primitiveManager);
6463
6463
  if (this.isConnected()) {
6464
6464
  this.createStompSubscriptions(domain, service, primitive, primitiveManager);
6465
6465
  return primitiveManager.subject.asObservable();
@@ -6480,7 +6480,7 @@ var WebsocketService = /** @class */ (function () {
6480
6480
  * Retorna todos os eventos ouvidos pela primitiva com os respectivos identificadores.
6481
6481
  * @typeParam `<T>` Tipo do evento retornado pela primitiva.
6482
6482
  * @param primitive Primitiva que será "observada" pelo client.
6483
- * @param identifiers Array com os indentificadores interessados.
6483
+ * @param identifiers Array com os identificadores interessados.
6484
6484
  * @return Array contendo o último evento recebido de cada identificador fornecido.
6485
6485
  */
6486
6486
  WebsocketService.prototype.getPublishedEvents = function (primitive, identifiers) {
@@ -6522,7 +6522,6 @@ var WebsocketService = /** @class */ (function () {
6522
6522
  };
6523
6523
  WebsocketService.prototype.createStompSubscriptions = function (domain, service, primitive, primitiveManager) {
6524
6524
  var withTokenUrl = this.getSubscriptionUrlWithToken(domain, service, primitive);
6525
- this.primitiveManagers.set(primitive, primitiveManager);
6526
6525
  var stompSubscriptionWithToken = this.createStompSubscription(withTokenUrl, primitiveManager);
6527
6526
  var withoutTokenUrl = this.getSubscriptionUrlWithoutToken(domain, service, primitive);
6528
6527
  var stompSubscriptionWithoutToken = this.createStompSubscription(withoutTokenUrl, primitiveManager);