File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,19 @@ export class BaseForm extends LitElement {
78
78
return this . captchaEnabled && ! this . currentUser && this . allowAnonymousComments ;
79
79
}
80
80
81
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
+ override updated ( changedProperties : Map < string , any > ) {
83
+ if (
84
+ changedProperties . has ( 'captchaEnabled' ) ||
85
+ changedProperties . has ( 'currentUser' ) ||
86
+ changedProperties . has ( 'allowAnonymousComments' )
87
+ ) {
88
+ if ( this . showCaptcha ) {
89
+ this . handleFetchCaptcha ( ) ;
90
+ }
91
+ }
92
+ }
93
+
81
94
async handleFetchCaptcha ( ) {
82
95
if ( ! this . showCaptcha ) {
83
96
return ;
@@ -143,7 +156,6 @@ export class BaseForm extends LitElement {
143
156
override connectedCallback ( ) : void {
144
157
super . connectedCallback ( ) ;
145
158
this . addEventListener ( 'keydown' , this . onKeydown ) ;
146
- this . handleFetchCaptcha ( ) ;
147
159
}
148
160
149
161
override disconnectedCallback ( ) : void {
You can’t perform that action at this time.
0 commit comments