summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaladox none <thomasmulhall410@yahoo.com>2019-01-24 01:26:49 +0000
committerPaladox none <thomasmulhall410@yahoo.com>2019-01-24 15:30:39 +0000
commit2f864ddee34faa189b0190e0d97111ee13bbef99 (patch)
treef9ffba5b8bce53bc31e759ddd594dfd3c6c47993
parent9f890ef7771dd646cdae31392b43c8256ba9ce29 (diff)
Fix inline editorv2.16.4
This fixes an issue where you saved a change but then deleted it. But then you decided to edit the same file again, this resulted in it restoring from the cache. Another example is editing a file then restoring it to it's previous state. Because it was cached it would restore it from the cache which is not was supposed to be happening. The cause of this was eraseEditableContentItem missing a call to _getEditableContentKey. Bug: Issue 10371 Change-Id: I47e4ca216804f0a86b1cec4ac549bb0599e17cb2 (cherry picked from commit 621d8b3457c1d6521709c0dce6af6ad6ea4b0aa9)
-rw-r--r--polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js2
-rw-r--r--polygerrit-ui/app/elements/shared/gr-storage/gr-storage_test.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js b/polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js
index 62080a1768..c425609e02 100644
--- a/polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js
+++ b/polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js
@@ -72,7 +72,7 @@
},
eraseEditableContentItem(key) {
- this._storage.removeItem(key);
+ this._storage.removeItem(this._getEditableContentKey(key));
},
getPreferences() {
diff --git a/polygerrit-ui/app/elements/shared/gr-storage/gr-storage_test.html b/polygerrit-ui/app/elements/shared/gr-storage/gr-storage_test.html
index b7d73d43ae..6b89af2654 100644
--- a/polygerrit-ui/app/elements/shared/gr-storage/gr-storage_test.html
+++ b/polygerrit-ui/app/elements/shared/gr-storage/gr-storage_test.html
@@ -188,7 +188,7 @@ limitations under the License.
// eraseEditableContentItem performs as expected.
element.eraseEditableContentItem(key);
- assert.isNotOk(element._storage.getItem(key));
+ assert.isNotOk(element._storage.getItem(computedKey));
});
});
</script>