ktmud commented on a change in pull request #12593:
URL: https://github.com/apache/superset/pull/12593#discussion_r560723481
##########
File path: superset-frontend/src/explore/components/ExploreViewContainer.jsx
##########
@@ -404,7 +414,8 @@ function ExploreViewContainer(props) {
/>
)}
<Resizable
- defaultSize={{ width: 300 }}
+ onResize={onResize}
+ defaultSize={{ width: exploreSidebarWidth }}
Review comment:
I always do that in my other projects. Here's an example file with
typing for storage keys:
```ts
import { User } from 'graphql/job.graphql';
/**
* Local storage manager
*/
export function safeJsonParse(jsonString: string | null) {
if (jsonString === null) return null;
try {
return JSON.parse(jsonString);
} catch {
return null;
}
}
export type StorageKey = 'persistedStates' | 'hasWelcomed';
export type StorageValues = {
persistedStates: Record<string, any> | null;
hasWelcomed: boolean;
};
export const defaultStorageValues = {
userIdMap: null,
persistedStates: null,
hasWelcomed: false,
};
export function entries() {
Object.values(Storage).forEach(key => {
return [key, getItem(key)];
});
}
export function getItem<K extends StorageKey>(key: K): StorageValues[K] |
null {
return safeJsonParse(localStorage.getItem(key)) ??
defaultStorageValues[key];
}
export function setItem(key: StorageKey, value: string | number | object) {
return localStorage.setItem(key, JSON.stringify(value));
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]