Skip to content

Commit

Permalink
bugfix: optimized ui
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokang00010 committed May 2, 2024
1 parent c1aaa2c commit 8e006dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions pages/Chatroom.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ const Chatroom = ({ navigation, route }) => {
if (k.role === 'model' && k.type == 0) {
timeout += k.text.length
}
n.push(k)
setTimeout(() => {
console.log('setting history view', n)
setChatHistoryView(n)
}, timeout)
console.log('setting history view', [...n, k])
setChatHistoryView([...n, k])
}, timeout * 10)
n.push(k)
})
}
}
Expand Down Expand Up @@ -445,6 +445,7 @@ const Chatroom = ({ navigation, route }) => {
setIsTyping(true)
setTimeout(() => chatHistoryViewRef.current?.scrollToEnd({ animated: true }), 100)
triggerAnimation()
discardPendingMessageTimer()
setMenuStatus(false)
if (chatSession.current !== null) {
keepAliveTimer.current = setInterval(() => {
Expand All @@ -464,7 +465,6 @@ const Chatroom = ({ navigation, route }) => {
onChangeText={v => {
setChatMessageInput(v)
console.log('triggerred reset pending msg timer by typing')
discardPendingMessageTimer()
}} mode='flat' style={{ flex: 16, maxHeight: Dimensions.get('window').height * 0.2 }} multiline={true} label={'Type messages'}></TextInput>
<IconButton icon="send" style={{ flex: 2 }} onPress={() => {
uploadAllAttachment().then(() => {
Expand Down
10 changes: 5 additions & 5 deletions pages/EditTTSService.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const AddRefAudioDialog = ({ state, onOk, onErr, onDismiss }) => {
<TextInput
mode='outlined'
ref={refAudioNameRef}
style={{ marginTop: 10, width: '100%', backgroundColor: 'rgba(0,0,0,0)' }}
style={{ marginTop: 10, width: '100%' }}
label={'Reference audio name'}
placeholder='E.g. narrative, pleased, disappointed...'
value={refAudioName}
Expand All @@ -75,7 +75,7 @@ const AddRefAudioDialog = ({ state, onOk, onErr, onDismiss }) => {
<TextInput
mode='outlined'
ref={refAudioTextRef}
style={{ marginTop: 10, width: '100%', backgroundColor: 'rgba(0,0,0,0)' }}
style={{ marginTop: 10, width: '100%' }}
label={'Reference audio text'}
placeholder='The text content of reference audio'
value={refAudioText}
Expand All @@ -84,7 +84,7 @@ const AddRefAudioDialog = ({ state, onOk, onErr, onDismiss }) => {
<TextInput
mode='outlined'
ref={refAudioPathRef}
style={{ marginTop: 10, width: '100%', backgroundColor: 'rgba(0,0,0,0)' }}
style={{ marginTop: 10, width: '100%' }}
label={'Reference audio path'}
placeholder='The path to the audio file on TTS service'
value={refAudioPath}
Expand All @@ -93,7 +93,7 @@ const AddRefAudioDialog = ({ state, onOk, onErr, onDismiss }) => {
<TextInput
mode='outlined'
ref={refAudioLanguageRef}
style={{ marginTop: 10, width: '100%', backgroundColor: 'rgba(0,0,0,0)' }}
style={{ marginTop: 10, width: '100%' }}
label={'Reference audio language'}
placeholder='en, auto, ...'
value={refAudioLanguage}
Expand Down Expand Up @@ -184,7 +184,7 @@ const EditTTSService = ({ navigation, route }) => {
scrollViewRef.current?.scrollToEnd({ animated: true })
}} accessible={false} style={{ height: '100%' }}>
<>
<ScrollView ref={scrollViewRef} style={{'height': '100%'}}>
<ScrollView ref={scrollViewRef} style={{ 'height': '100%' }}>
<View style={{ alignItems: 'center', justifyContent: 'center', marginBottom: 40 }}>
<TextInput
label="TTS Service name"
Expand Down

0 comments on commit 8e006dd

Please sign in to comment.