(props)
| 51367 | if (snapshotOnLoad && snapshotOnLoad.dataSource && snapshotOnLoad.dataSource.dataSourceType === "local") snapshotOnLoad = null; |
| 51368 | class SandDanceApp extends _react.Component { |
| 51369 | constructor(props){ |
| 51370 | super(props); |
| 51371 | this.state = { |
| 51372 | compactUI: !!localStorage.getItem("compactUI"), |
| 51373 | dialogMode: null, |
| 51374 | dataSource: snapshotOnLoad && snapshotOnLoad.dataSource || props.dataSources[0], |
| 51375 | darkTheme: props.darkTheme |
| 51376 | }; |
| 51377 | this.viewerOptions = getViewerOptions(this.state.darkTheme, props.themeColors); |
| 51378 | this.handlers = { |
| 51379 | hashchange: (e)=>{ |
| 51380 | const snapshot = getSnapshotFromHash(); |
| 51381 | if (snapshot) this.explorer && this.explorer.calculate(()=>this.hydrateSnapshot(snapshot)); |
| 51382 | }, |
| 51383 | resize: (e)=>{ |
| 51384 | this.explorer && this.explorer.resize(); |
| 51385 | } |
| 51386 | }; |
| 51387 | this.wireEventHandlers(true); |
| 51388 | this.changeColorScheme(this.state.darkTheme); |
| 51389 | } |
| 51390 | wireEventHandlers(add) { |
| 51391 | for(let key in this.handlers)if (add) window.addEventListener(key, this.handlers[key]); |
| 51392 | else window.removeEventListener(key, this.handlers[key]); |
nothing calls this directly
no test coverage detected