@@ -348,7 +348,9 @@ export default class ChatInput {
348
348
349
349
private fileSelectionPromise : CancellablePromise < File [ ] > ;
350
350
351
- public readonly paidMessageInterceptor : PaidMessagesInterceptor ;
351
+ public paidMessageInterceptor : PaidMessagesInterceptor ;
352
+
353
+ private starsState : ReturnType < ChatInput [ 'constructStarsState' ] > ;
352
354
353
355
constructor (
354
356
public chat : Chat ,
@@ -361,12 +363,6 @@ export default class ChatInput {
361
363
this . excludeParts = { } ;
362
364
this . isFocused = false ;
363
365
this . emoticonsDropdown = emoticonsDropdown ;
364
-
365
- this . paidMessageInterceptor = new PaidMessagesInterceptor ( chat , managers ) ;
366
-
367
- this . getMiddleware ( ) . onDestroy ( ( ) => {
368
- this . paidMessageInterceptor . dispose ( ) ;
369
- } ) ;
370
366
}
371
367
372
368
public construct ( ) {
@@ -477,6 +473,13 @@ export default class ChatInput {
477
473
const c = this . controlContainer = document . createElement ( 'div' ) ;
478
474
c . classList . add ( 'chat-input-control' , 'chat-input-wrapper' ) ;
479
475
this . inputContainer . append ( c ) ;
476
+
477
+ this . paidMessageInterceptor = new PaidMessagesInterceptor ( this . chat , this . managers ) ;
478
+ this . getMiddleware ( ) . onDestroy ( ( ) => {
479
+ this . paidMessageInterceptor . dispose ( ) ;
480
+ } ) ;
481
+
482
+ this . starsState = this . constructStarsState ( ) ;
480
483
}
481
484
482
485
public freezeFocused ( focused : boolean ) {
@@ -3470,7 +3473,7 @@ export default class ChatInput {
3470
3473
this . updateMessageInputPlaceholder ( params ) ;
3471
3474
}
3472
3475
3473
- private starsState = createRoot ( dispose => {
3476
+ private constructStarsState = ( ) => createRoot ( ( dispose ) => {
3474
3477
const middleware = this . getMiddleware ( ) ;
3475
3478
middleware . onDestroy ( ( ) => void dispose ( ) ) ;
3476
3479
0 commit comments