File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,9 @@ class WelcomeMessage {
96
96
} ;
97
97
const pageFocusHandler = new PageFocusHandler ( ) ;
98
98
pageFocusHandler . addFocusCallback ( reflesh_render_status ) ;
99
+
100
+ // call update when page size change, call this.update when page size change
101
+ window . addEventListener ( 'resize' , this . update . bind ( this ) ) ;
99
102
}
100
103
101
104
begin_render ( ) {
@@ -207,9 +210,8 @@ class WelcomeMessage {
207
210
const width_to_hide_welcome = 1200 ;
208
211
if ( ! await this . isChatbotEmpty ( ) || page_width < width_to_hide_welcome || welcome_card_overflow ) {
209
212
if ( this . visible ) {
210
- // console.log("remove welcome");
211
- this . removeWelcome ( ) ;
212
- this . visible = false ;
213
+ console . log ( "remove welcome" ) ;
214
+ this . removeWelcome ( ) ; this . visible = false ; // this two lines must always be together
213
215
this . card_array = [ ] ;
214
216
this . static_welcome_message_previous = [ ] ;
215
217
}
@@ -218,9 +220,8 @@ class WelcomeMessage {
218
220
if ( this . visible ) {
219
221
return ;
220
222
}
221
- // console.log("welcome");
222
- this . showWelcome ( ) ;
223
- this . visible = true ;
223
+ console . log ( "show welcome" ) ;
224
+ this . showWelcome ( ) ; this . visible = true ; // this two lines must always be together
224
225
this . startRefleshCards ( ) ;
225
226
}
226
227
You can’t perform that action at this time.
0 commit comments