@social-mail/social-mail-web-server 1.4.781 → 1.4.783

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.4.781",
3
+ "version": "1.4.783",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -54,7 +54,7 @@ export default class MailboxContactEvents extends AuthenticatedEvents<MailboxCon
54
54
  // and set it as lastReplyID
55
55
 
56
56
  // check if there are any open threads..
57
- if (entity.openThreads) {
57
+ if (openThreads) {
58
58
 
59
59
  const dateCreated = DateTime.now;
60
60
  const dateSent = dateCreated;
@@ -96,6 +96,11 @@ export default class MailboxContactEvents extends AuthenticatedEvents<MailboxCon
96
96
  lastReplyID: p.emailID
97
97
  }));
98
98
 
99
+ await db.mailboxes.where(entity, (p) => (x) => x.mailboxID === p.mailboxID)
100
+ .update(entity, (p) => (x) => ({
101
+ openThreads: Sql.math.max(0, x.openThreads - p.openThreads)
102
+ }));
103
+
99
104
  entity.openThreads = 0;
100
105
 
101
106
  }
@@ -3,7 +3,7 @@ import semver from "semver";
3
3
 
4
4
  export default async function seedUI(config: DBConfig) {
5
5
 
6
- const version = "1.2.308";
6
+ const version = "1.2.309";
7
7
 
8
8
  const existing = await config.get(UIPackageConfig, false);
9
9
  if (existing) {