added message parser, use for chat/channel

This commit is contained in:
Ren Amamiya
2023-04-17 08:30:44 +07:00
parent 637e081558
commit 15968db4a6
3 changed files with 54 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
import { messageParser } from '@utils/parser';
import { nip04 } from 'nostr-tools';
import { useCallback, useEffect, useState } from 'react';
@@ -30,5 +32,5 @@ export const useDecryptMessage = (
decrypt().catch(console.error);
}, [decrypt]);
return content;
return content.length > 0 ? messageParser(content) : '';
};