-
Notifications
You must be signed in to change notification settings - Fork 31
save height of down panel in local storage #62 #74
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for the contribution @wcastand, I've been hoping to look into this as well for a while.
Just check out my comment about making sure localStorage is usable, otherwise it looks good.
You can safely ignore all those changes to dist
, it's a recurring problem we're solving.
@@ -86,6 +86,13 @@ class Layout extends React.Component { | |||
downPanelDefaultSize = downPanelInRight ? 400 : 200; | |||
} | |||
|
|||
if(typeof localStorage !== 'undefined') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not enough to make sure localStorage is usable. When using Safari in private mode, you'll run into issues because localStorage is defined, but the quota is set to 0, meaning that if you try to setItem, the browser will throw an error.
Pretty simple to get around though, could do something like this:
const hasLocalStorage = () => {
try {
localStorage.setItem('yo', 'yo')
localStorage.removeItem('yo')
return true
} catch(e) {
return false
}
}
@@ -108,6 +115,13 @@ class Layout extends React.Component { | |||
resizerChildren={downPanelInRight ? vsplit : hsplit} | |||
onDragStarted={onDragStart} | |||
onDragFinished={onDragEnd} | |||
onChange={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and also this, @wcastand check out the conflict that came up due to another PR getting merged, make sure to it plays along :)
The project wasn't build and the dist files aren't updated but i didn't find the npm script to build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @wcastand!
Hi, i don't know why there are changes in all those files i only changes
src/modules/ui/components/layout/index.js
andsrc/modules/ui/components/shortcuts_help.js
the last one had a eslint error.If that's not suppose to happen (all the change in files) let me know and i'll make an other PR :)
Pr associated with the issue #62