Skip to content

Commit 84c914f

Browse files
committed
fine tune edge cases
1 parent f0851e4 commit 84c914f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web_src/js/features/repo-issue-edit.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ async function tryOnEditContent(e) {
3232

3333
const saveAndRefresh = async (e) => {
3434
e.preventDefault();
35-
form.classList.remove('ignore-dirty');
3635
renderContent.classList.add('is-loading');
3736
showElem(renderContent);
3837
hideElem(editContentZone);
@@ -52,6 +51,7 @@ async function tryOnEditContent(e) {
5251
showErrorToast(data.errorMessage);
5352
return;
5453
}
54+
form.classList.remove('ignore-dirty'); // the form is no longer dirty
5555
reinitializeAreYouSure(form);
5656
editContentZone.setAttribute('data-content-version', data.contentVersion);
5757
if (!data.content) {
@@ -101,6 +101,7 @@ async function tryOnEditContent(e) {
101101
cancelButton.addEventListener('click', cancelAndReset);
102102
form.addEventListener('submit', saveAndRefresh);
103103
}
104+
form.classList.remove('ignore-dirty');
104105

105106
// FIXME: ideally here should reload content and attachment list from backend for existing editor, to avoid losing data
106107
if (!comboMarkdownEditor.value()) {

0 commit comments

Comments
 (0)