diff --git a/dashboard/src/components/projects/EditProject.vue b/dashboard/src/components/projects/EditProject.vue index 8a55e39963..ab8a9b1c15 100644 --- a/dashboard/src/components/projects/EditProject.vue +++ b/dashboard/src/components/projects/EditProject.vue @@ -239,14 +239,14 @@ limitations under the License. }, internalProject: { handler(newValue) { - // this.saveComponentState(this.componentName, newValue); + this.saveComponentState(this.componentName, newValue); }, deep: true, }, }, methods: { discardChanges(reload = false) { - // this.clearComponentState(this.componentName); + this.clearComponentState(this.componentName); if (reload) { this.restoredFromStorage = false; this.loadComponent(); @@ -308,7 +308,7 @@ limitations under the License. this.canEditProjectId = canEdit; }, close(e) { - // this.clearComponentState(this.componentName); + this.clearComponentState(this.componentName); this.hideModal(e); }, publishHidden(e) { @@ -318,7 +318,7 @@ limitations under the License. this.msgConfirm('You have unsaved changes. Discard?', 'Discard Changes?', 'Discard Changes', 'Continue Editing') .then((res) => { if (res) { - // this.clearComponentState(this.componentName); + this.clearComponentState(this.componentName); this.hideModal(e); this.$nextTick(() => this.$announcer.polite('Changes discarded')); } else { @@ -328,7 +328,7 @@ limitations under the License. } else if (this.tooltipShowing && typeof e.preventDefault === 'function') { e.preventDefault(); } else { - // this.clearComponentState(this.componentName); + this.clearComponentState(this.componentName); this.hideModal(e); } }, diff --git a/dashboard/src/components/utils/SaveComponentStateLocallyMixin.vue b/dashboard/src/components/utils/SaveComponentStateLocallyMixin.vue index 0562f0147c..49251d226c 100644 --- a/dashboard/src/components/utils/SaveComponentStateLocallyMixin.vue +++ b/dashboard/src/components/utils/SaveComponentStateLocallyMixin.vue @@ -17,6 +17,7 @@ limitations under the License. import { get, set, del, } from 'idb-keyval'; + import { isProxy, toRaw } from 'vue'; export default { name: 'SaveComponentStateLocallyMixin', @@ -28,7 +29,11 @@ limitations under the License. }, methods: { saveComponentState(key, data) { - set(key, data); + let dataToSave = data; + if (isProxy(dataToSave)) { + dataToSave = toRaw(dataToSave); + } + set(key, dataToSave); }, loadComponentState(key) { return get(key);