Commit 54168362 authored by Simon Knox's avatar Simon Knox

don't show "Someone edited the issue" warning when saving issue

don't need to check for form visible because error message isn't rendered otherwise
parent 4e8d6507
......@@ -204,13 +204,7 @@ export default {
method: 'getData',
successCallback: (res) => {
const data = res.json();
const shouldUpdate = this.store.stateShouldUpdate(data);
this.store.updateState(data);
if (this.showForm && (shouldUpdate.title || shouldUpdate.description)) {
this.store.formState.lockedWarningVisible = true;
}
},
errorCallback(err) {
throw new Error(err);
......
......@@ -12,6 +12,10 @@ export default class Store {
}
updateState(data) {
if (this.stateShouldUpdate(data)) {
this.formState.lockedWarningVisible = true;
}
this.state.titleHtml = data.title;
this.state.titleText = data.title_text;
this.state.descriptionHtml = data.description;
......@@ -23,10 +27,8 @@ export default class Store {
}
stateShouldUpdate(data) {
return {
title: this.state.titleText !== data.title_text,
description: this.state.descriptionText !== data.description_text,
};
return this.state.titleText !== data.title_text ||
this.state.descriptionText !== data.description_text;
}
setFormState(state) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment