diff --git a/web_src/js/features/repo-issue-edit.ts b/web_src/js/features/repo-issue-edit.ts index 3838c4f0416..4a112368f46 100644 --- a/web_src/js/features/repo-issue-edit.ts +++ b/web_src/js/features/repo-issue-edit.ts @@ -97,11 +97,9 @@ async function tryOnEditContent(e: Event) { cancelButton.addEventListener('click', cancelAndReset); form.addEventListener('submit', saveAndRefresh); } - - // FIXME: ideally here should reload content and attachment list from backend for existing editor, to avoid losing data - if (!comboMarkdownEditor.value()) { - comboMarkdownEditor.value(rawContent.textContent); - } + // when the content has changed on server side, there is no sync, and this page doesn't have the latest content, + // the editor still shows the old content, server will reject end user's submit by "data-content-version" check + comboMarkdownEditor.value(rawContent.textContent); comboMarkdownEditor.switchTabToEditor(); comboMarkdownEditor.focus(); triggerUploadStateChanged(comboMarkdownEditor.container);