mirror of
https://hk.gh-proxy.com/https://github.com/NodeBB/nodebb-plugin-emoji.git
synced 2025-10-04 01:20:58 +08:00
fix: add checks
This commit is contained in:
parent
ec908c1fb0
commit
767c4b65fd
1 changed files with 8 additions and 6 deletions
14
lib/index.ts
14
lib/index.ts
|
@ -79,12 +79,14 @@ export async function filterMessagingLoadRoom<Payload extends {
|
|||
}[];
|
||||
};
|
||||
}>(data: Payload): Promise<Payload> {
|
||||
data.room.composerActions.push({
|
||||
action: 'emoji',
|
||||
class: 'd-none d-md-flex',
|
||||
icon: 'fa-smile',
|
||||
title: '[[emoji:composer.title]]',
|
||||
});
|
||||
if (data && data.room && Array.isArray(data.room.composerActions)) {
|
||||
data.room.composerActions.push({
|
||||
action: 'emoji',
|
||||
class: 'd-none d-md-flex',
|
||||
icon: 'fa-smile',
|
||||
title: '[[emoji:composer.title]]',
|
||||
});
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue