clear settings temp storage
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2294,6 +2294,10 @@ class ListRecordView extends View {
|
||||
|
||||
onRemove() {
|
||||
this.destroyStickyBar();
|
||||
|
||||
if (this._listSettingsHelper) {
|
||||
this._listSettingsHelper.clearTemporaryStorage();
|
||||
}
|
||||
}
|
||||
|
||||
afterRender() {
|
||||
|
||||
Reference in New Issue
Block a user