Fix SettingLayout

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-10-14 15:58:25 -04:00
1 parent 37feed7e1e
commit 72796d5813
2 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -38,6 +38,6 @@ fetchMock.enableMocks();
// Mock __non_webpack_require__ for tests
globalThis.__non_webpack_require__ = jest.fn();
process.on("unhandledRejection", (err) => {
process.on("unhandledRejection", (err: any) => {
fail(err);
});
@@ -50,8 +50,13 @@ export class SettingLayout extends React.Component<SettingLayoutProps> {
static defaultProps = defaultProps as object;
async componentDidMount() {
const { hash } = window.location;
if (hash) {
document.querySelector(hash)?.scrollIntoView();
}
window.addEventListener("keydown", this.onEscapeKey);
document.querySelector(window.location.hash)?.scrollIntoView();
}
componentWillUnmount() {