Skip to content

Commit e3478ce

Browse files
committed
apply CR suggestions from @silverwind
1 parent 219e94a commit e3478ce

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

web_src/js/features/comp/ComboMarkdownEditor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

web_src/js/features/repo-release.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)