@@ -4,26 +4,30 @@ import {observer} from 'mobx-react-lite';
44
55import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons' ;
66
7- import type { Message } from 'revolt.js' ;
7+ import type { API } from 'revolt.js' ;
88
99import { styles } from '../Theme' ;
1010import { Avatar , Text , Username } from './common/atoms' ;
1111import { MarkdownView } from './common/MarkdownView' ;
1212import { commonValues , ThemeContext } from '@clerotri/lib/themes' ;
1313import { parseRevoltNodes } from '../lib/utils' ;
14+ import { client } from '@clerotri/lib/client' ;
1415
1516export const Notification = observer (
1617 ( {
1718 message,
1819 dismiss,
1920 openChannel,
2021 } : {
21- message : Message | null ;
22+ message : API . Message | null ;
2223 dismiss : Function ;
2324 openChannel : Function ;
2425 } ) => {
2526 const { currentTheme} = useContext ( ThemeContext ) ;
2627 if ( message ) {
28+ const author = client . users . get ( message . author ) ;
29+ const channel = client . channels . get ( message . channel ) ;
30+
2731 return (
2832 < TouchableOpacity
2933 style = { {
@@ -42,7 +46,7 @@ export const Notification = observer(
4246 flexDirection : 'row' ,
4347 overflow : 'hidden' ,
4448 } } >
45- < Avatar user = { message . author } size = { 35 } />
49+ < Avatar user = { author } size = { 35 } />
4650 < View
4751 style = { {
4852 marginHorizontal : commonValues . sizes . medium ,
@@ -54,12 +58,12 @@ export const Notification = observer(
5458 flexDirection : 'row' ,
5559 } } >
5660 < Username
57- user = { message . author }
58- server = { message . channel ?. server }
61+ user = { author }
62+ server = { channel ?. server }
5963 />
6064 < Text style = { { fontWeight : 'bold' } } >
6165 { ' ' }
62- ({ message . channel ?. name ?? message . channel ?. _id } )
66+ ({ channel ?. name ?? channel ?. _id } )
6367 </ Text >
6468 </ View >
6569 { message . content ? (
0 commit comments