@nocobase/plugin-notification-in-app-message 1.8.15 → 1.9.0-alpha.10

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.
@@ -9,15 +9,15 @@
9
9
 
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
- "@nocobase/client": "1.8.15",
13
- "@nocobase/plugin-notification-manager": "1.8.15",
14
- "@nocobase/plugin-mobile": "1.8.15",
15
- "@nocobase/utils": "1.8.15",
12
+ "@nocobase/client": "1.9.0-alpha.10",
13
+ "@nocobase/plugin-notification-manager": "1.9.0-alpha.10",
14
+ "@nocobase/plugin-mobile": "1.9.0-alpha.10",
15
+ "@nocobase/utils": "1.9.0-alpha.10",
16
16
  "react-i18next": "11.18.6",
17
- "@nocobase/server": "1.8.15",
17
+ "@nocobase/server": "1.9.0-alpha.10",
18
18
  "sequelize": "6.35.2",
19
- "@nocobase/actions": "1.8.15",
20
- "@nocobase/database": "1.8.15",
19
+ "@nocobase/actions": "1.9.0-alpha.10",
20
+ "@nocobase/database": "1.9.0-alpha.10",
21
21
  "antd": "5.24.2",
22
22
  "@formily/reactive-react": "2.3.0",
23
23
  "antd-style": "3.7.1",
@@ -26,7 +26,7 @@ module.exports = {
26
26
  "react-router-dom": "6.28.1",
27
27
  "@formily/core": "2.3.0",
28
28
  "@ant-design/icons": "5.6.1",
29
- "@nocobase/plugin-workflow": "1.8.15",
29
+ "@nocobase/plugin-workflow": "1.9.0-alpha.10",
30
30
  "@formily/reactive": "2.3.0",
31
31
  "@formily/shared": "2.3.2"
32
32
  };
@@ -10,8 +10,7 @@ import { SendFnType, BaseNotificationChannel } from '@nocobase/plugin-notificati
10
10
  import { InAppMessageFormValues } from '../types';
11
11
  export default class InAppNotificationChannel extends BaseNotificationChannel {
12
12
  load(): Promise<void>;
13
- onMessageCreated: (model: any, options: any) => Promise<void>;
14
- onMessageUpdated: (model: any, options: any) => Promise<void>;
13
+ onMessageCreatedOrUpdated: (model: any, options: any) => Promise<void>;
15
14
  saveMessageToDB: ({ content, status, userId, title, channelName, receiveTimestamp, options, }: {
16
15
  content: string;
17
16
  userId: number;
@@ -51,22 +51,10 @@ class InAppNotificationChannel extends import_plugin_notification_manager.BaseNo
51
51
  // this.userClientsMap = {};
52
52
  // }
53
53
  async load() {
54
- this.app.db.on(`${import_types2.InAppMessagesDefinition.name}.afterCreate`, this.onMessageCreated);
55
- this.app.db.on(`${import_types2.InAppMessagesDefinition.name}.afterUpdate`, this.onMessageUpdated);
54
+ this.app.db.on(`${import_types2.InAppMessagesDefinition.name}.afterSave`, this.onMessageCreatedOrUpdated);
56
55
  this.defineActions();
57
56
  }
58
- onMessageCreated = async (model, options) => {
59
- const userId = model.userId;
60
- this.app.emit("ws:sendToTag", {
61
- tagKey: "userId",
62
- tagValue: userId,
63
- message: {
64
- type: "in-app-message:created",
65
- payload: model.toJSON()
66
- }
67
- });
68
- };
69
- onMessageUpdated = async (model, options) => {
57
+ onMessageCreatedOrUpdated = async (model, options) => {
70
58
  const userId = model.userId;
71
59
  this.app.emit("ws:sendToTag", {
72
60
  tagKey: "userId",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-notification-in-app-message",
3
- "version": "1.8.15",
3
+ "version": "1.9.0-alpha.10",
4
4
  "displayName": "Notification: In-app message",
5
5
  "displayName.zh-CN": "通知:站内信",
6
6
  "description": "It supports users in receiving real-time message notifications within the NocoBase application.",
@@ -26,5 +26,5 @@
26
26
  "@nocobase/test": "1.x",
27
27
  "react-router-dom": "^6.x"
28
28
  },
29
- "gitHead": "6cbf5a6ef2023ebaedce11c60351df858d4832b2"
29
+ "gitHead": "3e3aed34a0b93a6525b0f4e905307025e87785bb"
30
30
  }