File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -378,9 +378,10 @@ export class ComboMarkdownEditor {
378378
379379 if ( this . easyMDE ) {
380380 this . easyMDE . value ( v ) ;
381- } else {
382- this . textarea . value = v ;
383381 }
382+ // Always update the underlying textarea so consumers remain in sync.
383+ this . textarea . value = v ;
384+ this . textarea . dispatchEvent ( new Event ( 'input' , { bubbles : true } ) ) ;
384385 this . textareaAutosize ?. resizeToFit ( ) ;
385386 }
386387
Original file line number Diff line number Diff line change @@ -83,12 +83,7 @@ function initGenerateReleaseNotes() {
8383 const resp = await POST ( generateUrl , {
8484 data : form ,
8585 } ) ;
86- let data : any = { } ;
87- try {
88- data = await resp . json ( ) ;
89- } catch {
90- data = { } ;
91- }
86+ const data = await resp . json ( ) ;
9287 if ( ! resp . ok ) {
9388 throw new Error ( data . errorMessage || data . error || resp . statusText ) ;
9489 }
@@ -115,8 +110,9 @@ function applyGeneratedReleaseNotes(content: string) {
115110 document . querySelector < HTMLTextAreaElement > ( 'textarea[name="content"]' ) ;
116111
117112 const comboEditor = getComboMarkdownEditor ( editorContainer ) ;
118- if ( comboEditor ?. easyMDE ) {
119- comboEditor . easyMDE . value ( content ) ;
113+ if ( comboEditor ) {
114+ comboEditor . value ( content ) ;
115+ return ;
120116 }
121117
122118 if ( textarea ) {
You can’t perform that action at this time.
0 commit comments