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

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"], 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, MailboxDropDown, cacheSeconds, cacheVersion;
34301
34301
  _export("default", void 0);
34302
34302
  return {
34303
34303
  setters: [function (_tslib) {
@@ -34318,8 +34318,12 @@ 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;
34321
34323
  }],
34322
34324
  execute: function () {
34325
+ cacheSeconds = CacheTTL.seconds.oneMonth;
34326
+ cacheVersion = "v1";
34323
34327
  _export("default", MailboxDropDown = class MailboxDropDown extends DropDown {
34324
34328
  constructor(app, e) {
34325
34329
  super(app, e);
@@ -34337,10 +34341,20 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
34337
34341
  }));
34338
34342
  const subscribe = '%subscribe%';
34339
34343
  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();
34344
+ let item = null;
34345
+ if (value) {
34346
+ item = yield this.entityService.query(Mailbox).where({
34347
+ value
34348
+ }, p => x => x.mailboxID === p.value).firstOrDefault({
34349
+ cacheSeconds,
34350
+ cacheVersion
34351
+ });
34352
+ }
34353
+ if (!item) {
34354
+ item = yield this.entityService.query(Mailbox).where({
34355
+ subscribe
34356
+ }, p => x => x.isChannel === false && !Sql.text.like(x.emailAddress.emailAddress, p.subscribe)).orderByDescending(x => x.dateUpdated).include(x => x.emailAddress).firstOrDefault();
34357
+ }
34344
34358
  this.items = [item];
34345
34359
  this.selectedItem = item;
34346
34360
  });
@@ -34364,6 +34378,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
34364
34378
  }
34365
34379
  const items = yield q.include(x => x.emailAddress).toPagedList({
34366
34380
  size: 10,
34381
+ cacheSeconds,
34382
+ cacheVersion,
34367
34383
  cancelToken
34368
34384
  });
34369
34385
  return items.items;