mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 06:18:07 +03:00
Don't auto-close drawer when window isnt loaded (#827)
Summary: This was triggering frequently for me, auto-closing my ISL after I closed the sidebar and reopened it later. This case seems irrelevant and likely indicative that the frame just isnt loaded yet, so just skipping the autoclose. https://github.com/facebook/sapling/issues/768 Pull Request resolved: https://github.com/facebook/sapling/pull/827 Reviewed By: evangrayk Differential Revision: D53138052 fbshipit-source-id: 1a548019652da481effeec0f054dab6947855dc4
This commit is contained in:
parent
6d2a9bede4
commit
fa68f75f79
@ -27,6 +27,10 @@ export const islDrawerState = localStorageBackedAtom<AllDrawersState>('isl.drawe
|
||||
// This allows collapsing even if the size has been previous persisted.
|
||||
function autoCloseBasedOnWindowWidth() {
|
||||
const windowWidth = getWindowWidthInPixels();
|
||||
if (windowWidth === 0) {
|
||||
// window not loaded yet
|
||||
return;
|
||||
}
|
||||
|
||||
const current = readAtom(islDrawerState).right.size;
|
||||
const setDrawer = (state: DrawerState) => {
|
||||
|
Loading…
Reference in New Issue
Block a user