@social-mail/social-mail-client 1.4.156 → 1.4.158

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.
@@ -34294,10 +34294,10 @@ System.register(["@web-atoms/core/dist/core/XNode", "@web-atoms/web-controls/dis
34294
34294
 
34295
34295
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/controls/mailboxes/MailboxDropDown");
34296
34296
 
34297
- System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atoms/web-controls/dist/basic/DropDown", "../../../services/EntityService", "../../../model/model", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/core/Bind", "../../Sql"], function (_export, _context) {
34297
+ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atoms/web-controls/dist/basic/DropDown", "../../../services/EntityService", "../../../model/model", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/core/Bind", "../../Sql", "../../cache/CacheTTL", "@web-atoms/core/dist/core/sleep"], function (_export, _context) {
34298
34298
  "use strict";
34299
34299
 
34300
- var __awaiter, __decorate, __metadata, InjectProperty, DropDown, EntityService, Mailbox, XNode, Bind, Sql, MailboxDropDown;
34300
+ var __awaiter, __decorate, __metadata, InjectProperty, DropDown, EntityService, Mailbox, XNode, Bind, Sql, CacheTTL, sleep, MailboxDropDown, cacheSeconds, cacheVersion;
34301
34301
  _export("default", void 0);
34302
34302
  return {
34303
34303
  setters: [function (_tslib) {
@@ -34318,8 +34318,14 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
34318
34318
  Bind = _webAtomsCoreDistCoreBind.default;
34319
34319
  }, function (_Sql) {
34320
34320
  Sql = _Sql.Sql;
34321
+ }, function (_cacheCacheTTL) {
34322
+ CacheTTL = _cacheCacheTTL.CacheTTL;
34323
+ }, function (_webAtomsCoreDistCoreSleep) {
34324
+ sleep = _webAtomsCoreDistCoreSleep.default;
34321
34325
  }],
34322
34326
  execute: function () {
34327
+ cacheSeconds = CacheTTL.seconds.oneMonth;
34328
+ cacheVersion = "v1";
34323
34329
  _export("default", MailboxDropDown = class MailboxDropDown extends DropDown {
34324
34330
  constructor(app, e) {
34325
34331
  super(app, e);
@@ -34336,11 +34342,22 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
34336
34342
  items: Bind.oneWayAsync((s, e, cancelToken) => this.searchMailboxes(this.search, this.value, cancelToken))
34337
34343
  }));
34338
34344
  const subscribe = '%subscribe%';
34345
+ yield sleep(10);
34339
34346
  const value = (_a = this.value) !== null && _a !== void 0 ? _a : 0;
34340
- const item = yield this.entityService.query(Mailbox).where({
34341
- value,
34342
- subscribe
34343
- }, p => x => x.mailboxID === p.value || x.isChannel === false && !Sql.text.like(x.emailAddress.emailAddress, p.subscribe)).orderByDescending(x => x.dateUpdated).include(x => x.emailAddress).firstOrDefault();
34347
+ let item = null;
34348
+ if (value) {
34349
+ item = yield this.entityService.query(Mailbox).where({
34350
+ value
34351
+ }, p => x => x.mailboxID === p.value).firstOrDefault({
34352
+ cacheSeconds,
34353
+ cacheVersion
34354
+ });
34355
+ }
34356
+ if (!item) {
34357
+ item = yield this.entityService.query(Mailbox).where({
34358
+ subscribe
34359
+ }, p => x => x.isChannel === false && !Sql.text.like(x.emailAddress.emailAddress, p.subscribe)).orderByDescending(x => x.dateUpdated).include(x => x.emailAddress).firstOrDefault();
34360
+ }
34344
34361
  this.items = [item];
34345
34362
  this.selectedItem = item;
34346
34363
  });
@@ -34364,6 +34381,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
34364
34381
  }
34365
34382
  const items = yield q.include(x => x.emailAddress).toPagedList({
34366
34383
  size: 10,
34384
+ cacheSeconds,
34385
+ cacheVersion,
34367
34386
  cancelToken
34368
34387
  });
34369
34388
  return items.items;