File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed
Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -51,19 +51,23 @@ export class ChatRecordManage {
5151 this . loading . value = true
5252 }
5353 this . id = setInterval ( ( ) => {
54- const s = this . chat . buffer . shift ( )
55- if ( s !== undefined ) {
56- this . chat . answer_text = this . chat . answer_text + s
54+ if ( this . chat . buffer . length > 20 ) {
55+ this . chat . answer_text =
56+ this . chat . answer_text + this . chat . buffer . splice ( 0 , this . chat . buffer . length - 20 ) . join ( '' )
57+ } else if ( this . is_close ) {
58+ this . chat . answer_text = this . chat . answer_text + this . chat . buffer . join ( '' )
59+ this . chat . write_ed = true
60+ this . write_ed = true
61+ if ( this . loading ) {
62+ this . loading . value = false
63+ }
64+ if ( this . id ) {
65+ clearInterval ( this . id )
66+ }
5767 } else {
58- if ( this . is_close ) {
59- this . chat . write_ed = true
60- this . write_ed = true
61- if ( this . loading ) {
62- this . loading . value = false
63- }
64- if ( this . id ) {
65- clearInterval ( this . id )
66- }
68+ const s = this . chat . buffer . shift ( )
69+ if ( s !== undefined ) {
70+ this . chat . answer_text = this . chat . answer_text + s
6771 }
6872 }
6973 } , this . ms )
You can’t perform that action at this time.
0 commit comments