🐛 Fix collapse state persistence (#1546)
This commit is contained in:
@@ -28,7 +28,7 @@ const HomeMixin = {
|
||||
return this.$store.state.modalOpen;
|
||||
},
|
||||
pageId() {
|
||||
return (this.subPageInfo && this.subPageInfo.pageId) ? this.subPageInfo.pageId : 'home';
|
||||
return this.$store.state.currentConfigInfo?.confId || 'home';
|
||||
},
|
||||
},
|
||||
data: () => ({
|
||||
@@ -84,6 +84,14 @@ const HomeMixin = {
|
||||
searching(searchValue) {
|
||||
this.searchValue = searchValue || '';
|
||||
},
|
||||
/* Returns a unique ID based on the page and section name */
|
||||
makeSectionId(section) {
|
||||
const normalize = (str) => (
|
||||
str ? str.trim().toLowerCase().replace(/[^a-zA-Z0-9]/g, '-')
|
||||
: `unnamed-${(`000${Math.floor(Math.random() * 1000)}`).slice(-3)}`
|
||||
);
|
||||
return `${this.pageId || 'unknown-page'}-${normalize(section.name)}`;
|
||||
},
|
||||
/* Returns true if there is one or more sections in the config */
|
||||
checkTheresData(sections) {
|
||||
const localSections = localStorage[localStorageKeys.CONF_SECTIONS];
|
||||
|
||||
Reference in New Issue
Block a user