Make sure Changelog sheet shows up

Summary: Make sure that changelog is shown when using Sandy

Reviewed By: jknoxville

Differential Revision: D24832099

fbshipit-source-id: 6999dfcb55976104db476834446c13322f4b2402
This commit is contained in:
Michel Weststrate
2020-11-09 09:22:42 -08:00
committed by Facebook GitHub Bot
parent c02d5341f9
commit ce5783f14d

View File

@@ -20,12 +20,17 @@ import {useStore, useDispatch} from '../utils/useStore';
import {SandyContext} from './SandyContext'; import {SandyContext} from './SandyContext';
import {ConsoleLogs} from '../chrome/ConsoleLogs'; import {ConsoleLogs} from '../chrome/ConsoleLogs';
import {setStaticView} from '../reducers/connections'; import {setStaticView} from '../reducers/connections';
import {toggleLeftSidebarVisible} from '../reducers/application'; import {
ACTIVE_SHEET_CHANGELOG_RECENT_ONLY,
setActiveSheet,
toggleLeftSidebarVisible,
} from '../reducers/application';
import {AppInspect} from './appinspect/AppInspect'; import {AppInspect} from './appinspect/AppInspect';
import PluginContainer from '../PluginContainer'; import PluginContainer from '../PluginContainer';
import {ContentContainer} from './ContentContainer'; import {ContentContainer} from './ContentContainer';
import {Notification} from './notification/Notification'; import {Notification} from './notification/Notification';
import {SheetRenderer} from '../chrome/SheetRenderer'; import {SheetRenderer} from '../chrome/SheetRenderer';
import {hasNewChangesToShow} from '../chrome/ChangelogSheet';
export type ToplevelNavItem = export type ToplevelNavItem =
| 'appinspect' | 'appinspect'
@@ -79,6 +84,9 @@ export function SandyApp({logger}: {logger: Logger}) {
useEffect(() => { useEffect(() => {
registerStartupTime(logger); registerStartupTime(logger);
if (hasNewChangesToShow(window.localStorage)) {
dispatch(setActiveSheet(ACTIVE_SHEET_CHANGELOG_RECENT_ONLY));
}
// don't warn about logger, even with a new logger we don't want to re-register // don't warn about logger, even with a new logger we don't want to re-register
// eslint-disable-next-line // eslint-disable-next-line
}, []); }, []);