Skip to content

Commit

Permalink
Revert "Save sidebar state per session (#1606)"
Browse files Browse the repository at this point in the history
This reverts commit dd4f391.
  • Loading branch information
josevalim committed Oct 19, 2022
1 parent e85a7ea commit 0a08a61
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions assets/js/sidebar/sidebar-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ export function initialize () {
}

function setDefaultSidebarState () {
// check & set persistent session state
const persistenSessionState = sessionStorage.getItem('sidebar_state')
if (persistenSessionState === 'opened') return setClass(SIDEBAR_CLASS.opened)
if (persistenSessionState === 'closed') return setClass(SIDEBAR_CLASS.closed)

// else
setClass(isScreenSmall() ? SIDEBAR_CLASS.closed : SIDEBAR_CLASS.opened)
}

Expand Down Expand Up @@ -104,7 +98,6 @@ function isSidebarOpen () {
export function openSidebar () {
clearTimeoutIfAny()
setClass(SIDEBAR_CLASS.opening)
sessionStorage.setItem('sidebar_state', 'opened')

return new Promise((resolve, reject) => {
state.togglingTimeout = setTimeout(() => {
Expand All @@ -122,7 +115,6 @@ export function openSidebar () {
export function closeSidebar () {
clearTimeoutIfAny()
setClass(SIDEBAR_CLASS.closing)
sessionStorage.setItem('sidebar_state', 'closed')

return new Promise((resolve, reject) => {
state.togglingTimeout = setTimeout(() => {
Expand Down

0 comments on commit 0a08a61

Please sign in to comment.