Skip to content

EspoCRM – Open Source CRM Application

clear settings temp storage

Yuriiecad17289173
diff --git a/client/src/helpers/list/settings.js b/client/src/helpers/list/settings.js
index d845b27f35..38dfb1def4 100644
--- a/client/src/helpers/list/settings.js
+++ b/client/src/helpers/list/settings.js
@@ -63,13 +63,13 @@ class ListSettingsHelper {
* @internal
*
* @param {string} entityType
- * @param {string} type
+ * @param {string} key A key used for storage.
* @param {string} userId
* @param {{useStorage?: boolean}} options
*/
- constructor(entityType, type, userId, options = {}) {
+ constructor(entityType, key, userId, options = {}) {
/** @private */
- this.layoutColumnsKey = `${type}-${entityType}-${userId}`;
+ this.layoutColumnsKey = `${key}-${entityType}-${userId}`;
/**
* @private
@@ -140,6 +140,26 @@ class ListSettingsHelper {
return this.sessionStorage.clear(this.getSessionKey(key));
}
+
+ /**
+ * @internal
+ */
+ clearTemporaryStorage() {
+ if (this.useStorage) {
+ return;
+ }
+
+ const keys = [
+ 'listHiddenColumns',
+ 'listColumnResize',
+ 'listColumnsWidths',
+ ];
+
+ for (const key of keys) {
+ this.clearStored(this.getSessionKey(key));
+ }
+ }
+
/**
* @private
* @param {string} key
diff --git a/client/src/views/record/list.js b/client/src/views/record/list.js
index eef2f504e3..badf23ea83 100644
--- a/client/src/views/record/list.js
+++ b/client/src/views/record/list.js
@@ -2294,6 +2294,10 @@ class ListRecordView extends View {
onRemove() {
this.destroyStickyBar();
+
+ if (this._listSettingsHelper) {
+ this._listSettingsHelper.clearTemporaryStorage();
+ }
}
afterRender() {