(props: Props)
| 88 | public explorer: Explorer_Class; |
| 89 | |
| 90 | constructor(props: Props) { |
| 91 | super(props); |
| 92 | this.state = { |
| 93 | compactUI: !!localStorage.getItem('compactUI'), |
| 94 | dialogMode: null, |
| 95 | dataSource: snapshotOnLoad && snapshotOnLoad.dataSource || props.dataSources[0], |
| 96 | darkTheme: props.darkTheme, |
| 97 | }; |
| 98 | this.viewerOptions = getViewerOptions(this.state.darkTheme, props.themeColors); |
| 99 | this.handlers = { |
| 100 | hashchange: e => { |
| 101 | const snapshot = getSnapshotFromHash(); |
| 102 | if (snapshot) { |
| 103 | this.explorer && this.explorer.calculate(() => this.hydrateSnapshot(snapshot)); |
| 104 | } |
| 105 | }, |
| 106 | resize: e => { |
| 107 | this.explorer && this.explorer.resize(); |
| 108 | }, |
| 109 | }; |
| 110 | this.wireEventHandlers(true); |
| 111 | this.changeColorScheme(this.state.darkTheme); |
| 112 | } |
| 113 | |
| 114 | private wireEventHandlers(add: boolean) { |
| 115 | for (const key in this.handlers) { |
nothing calls this directly
no test coverage detected