diff --git a/packages/plugins/@nocobase/plugin-notification-in-app-message/src/client/components/Inbox.tsx b/packages/plugins/@nocobase/plugin-notification-in-app-message/src/client/components/Inbox.tsx
index a5370d1064..90a615795d 100644
--- a/packages/plugins/@nocobase/plugin-notification-in-app-message/src/client/components/Inbox.tsx
+++ b/packages/plugins/@nocobase/plugin-notification-in-app-message/src/client/components/Inbox.tsx
@@ -140,7 +140,7 @@ const InnerInbox = (props) => {
}
+ icon={}
onClick={onIconClick}
/>
diff --git a/packages/plugins/@nocobase/plugin-notification-manager/src/server/utils/compile.ts b/packages/plugins/@nocobase/plugin-notification-manager/src/server/utils/compile.ts
index e9496edb58..f910c28e35 100644
--- a/packages/plugins/@nocobase/plugin-notification-manager/src/server/utils/compile.ts
+++ b/packages/plugins/@nocobase/plugin-notification-manager/src/server/utils/compile.ts
@@ -9,25 +9,26 @@
import { Handlebars } from '@nocobase/utils';
+function deepCompile(template: unknown, data: Record): unknown {
+ if (typeof template === 'string') {
+ const c = Handlebars.compile(template);
+ return c(data);
+ } else if (Array.isArray(template)) {
+ return template.map((item) => deepCompile(item, data));
+ } else if (typeof template === 'object') {
+ const result = Object.keys(template).reduce((object, key) => {
+ const value = deepCompile(template[key], data);
+ return Object.assign(object, { [key]: value });
+ }, {});
+ return result;
+ } else {
+ return template;
+ }
+}
+
export function compile(template: Record, data: Record): Record {
if (!template) {
return {};
}
- const result = Object.keys(template).reduce((object, key) => {
- let c;
- let value = object[key];
- switch (typeof template[key]) {
- case 'object':
- value = compile(template[key], data);
- break;
- case 'string':
- c = Handlebars.compile(template[key]);
- value = c(data);
- break;
- default:
- break;
- }
- return Object.assign(object, { [key]: value });
- }, {});
- return result;
+ return deepCompile(template, data);
}