@@ -11,14 +11,15 @@ import SmartToyIcon from '@mui/icons-material/SmartToy'
11
11
import SettingsIcon from '@mui/icons-material/Settings'
12
12
import { useTranslation } from 'react-i18next'
13
13
import { Message , SessionType } from '../../shared/types'
14
- import { useAtomValue , useSetAtom } from 'jotai'
14
+ import { useAtom , useAtomValue , useSetAtom } from 'jotai'
15
15
import {
16
16
showMessageTimestampAtom ,
17
17
showModelNameAtom ,
18
18
showTokenCountAtom ,
19
19
showWordCountAtom ,
20
20
openSettingDialogAtom ,
21
21
enableMarkdownRenderingAtom ,
22
+ settingsAtom ,
22
23
} from '../stores/atoms'
23
24
import { currsentSessionPicUrlAtom , showTokenUsedAtom } from '../stores/atoms'
24
25
import * as scrollActions from '../stores/scrollActions'
@@ -44,6 +45,7 @@ export interface Props {
44
45
export default function Message ( props : Props ) {
45
46
const { t } = useTranslation ( )
46
47
const theme = useTheme ( )
48
+
47
49
48
50
const showMessageTimestamp = useAtomValue ( showMessageTimestampAtom )
49
51
const showModelName = useAtomValue ( showModelNameAtom )
@@ -102,6 +104,11 @@ export default function Message(props: Props) {
102
104
}
103
105
} , [ msg . content ] )
104
106
107
+ const hideInitMsg = ( ) => {
108
+ const [ settings , _1 ] = useAtom ( settingsAtom ) ;
109
+ return settings . hideInitialMessage ;
110
+ }
111
+
105
112
let content = msg . content
106
113
if ( typeof msg . content !== 'string' ) {
107
114
content = JSON . stringify ( msg . content )
@@ -146,6 +153,7 @@ export default function Message(props: Props) {
146
153
[ theme . breakpoints . down ( 'sm' ) ] : {
147
154
paddingX : '0.3rem' ,
148
155
} ,
156
+ display : msg ?. role === 'system' && hideInitMsg ( ) ? "none" : "initial"
149
157
} }
150
158
>
151
159
< Grid container wrap = "nowrap" spacing = { 1.5 } >
0 commit comments