web: ?sidebar= hides the sidebar, like ?sidebar=0

This commit is contained in:
Simon Michael 2019-08-17 17:00:08 +01:00
parent ef1bd24edc
commit e70c7123b7

View File

@ -228,7 +228,12 @@ shouldShowSidebar :: Handler Bool
shouldShowSidebar = do
msidebarparam <- lookupGetParam "sidebar"
msidebarcookie <- lookup "showsidebar" . reqCookies <$> getRequest
return $ maybe (msidebarcookie /= Just "0") (/="0") msidebarparam
return $
let disablevalues = ["","0"]
in maybe
(not $ msidebarcookie `elem` map Just disablevalues)
(not . (`elem` disablevalues))
msidebarparam
-- | Update our copy of the journal if the file changed. If there is an
-- error while reloading, keep the old one and return the error, and set a