feat: Regenerate chat message #2088 (#2166)

### What problem does this PR solve?

feat: Regenerate chat message #2088
### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-29 18:37:18 +08:00
committed by GitHub
parent 742d0f0ea9
commit a82f092dac
9 changed files with 157 additions and 28 deletions

View File

@ -16,8 +16,8 @@ export const buildMessageUuid = (message: Partial<Message | IMessage>) => {
return uuid();
};
export const getMessagePureId = (id: string) => {
const strings = id.split('_');
export const getMessagePureId = (id?: string) => {
const strings = id?.split('_') ?? [];
if (strings.length > 0) {
return strings.at(-1);
}