MCPcopy Index your code
hub / github.com/microsoft/SandDance / constructor

Method constructor

docs/app/js/sanddance-app.js:51369–51389  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

51367if (snapshotOnLoad && snapshotOnLoad.dataSource && snapshotOnLoad.dataSource.dataSourceType === "local") snapshotOnLoad = null;
51368class 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]);

Callers

nothing calls this directly

Calls 7

hydrateSnapshotMethod · 0.95
wireEventHandlersMethod · 0.95
changeColorSchemeMethod · 0.95
getViewerOptionsFunction · 0.70
getSnapshotFromHashFunction · 0.70
calculateMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected