| 15 | } |
| 16 | |
| 17 | write( config, nodes ) { |
| 18 | const serializedData = localStorage.getItem( Store.namespace ); |
| 19 | const data = serializedData ? JSON.parse(serializedData) : {}; |
| 20 | const config1 = {}; |
| 21 | for (const [key, value] of Object.entries(config)) { |
| 22 | if (typeof value != "function" ) config1[key] = value; |
| 23 | } |
| 24 | this.udoArr.push( JSON.stringify(data) ); |
| 25 | if (this.udoArr.length>6) this.udoArr.shift(); |
| 26 | const path = { config: config1, nodes }; |
| 27 | data[config.name] = path; |
| 28 | data['activePath'] = config.name; |
| 29 | localStorage.setItem(Store.namespace, JSON.stringify(data)); |
| 30 | } |
| 31 | |
| 32 | read( key ) { |
| 33 | const serializedData = localStorage.getItem( Store.namespace ); |