graceguo-supercat commented on a change in pull request #6257: Add sql lab 
localStorage config
URL: 
https://github.com/apache/incubator-superset/pull/6257#discussion_r230432715
 
 

 ##########
 File path: superset/assets/src/SqlLab/App.jsx
 ##########
 @@ -20,14 +20,27 @@ setupApp();
 const appContainer = document.getElementById('app');
 const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
 initFeatureFlags(bootstrapData.common.feature_flags);
-const state = getInitialState(bootstrapData);
+const initialState = getInitialState(bootstrapData);
+const sqlLabPersistStateConfig = {
+  paths: ['sqlLab'],
+  config: {
+    slicer: paths => (state) => {
+      const subset = {};
+      paths.forEach((path) => {
+        delete state[path].common; // eslint-disable-line no-param-reassign
 
 Review comment:
   this is a good question..we don't have many options on browser's 
localStorage if user didn't use sql lab. but if user didn't open sql lab for 2 
months he probably didn't critically depend on localStorage.
   
   this PR will help @jeffreythewang's feature: 
https://github.com/apache/incubator-superset/pull/4941. So I am thinking after 
a few new features in Sql Lab (a month long is also good), we can remove this 
cleanup line.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to