mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
disposeOnUmount
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
88b204f60c
commit
63fd8101f2
@ -2,7 +2,7 @@ import "./preferences.scss";
|
|||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { computed, observable, reaction } from "mobx";
|
import { computed, observable, reaction } from "mobx";
|
||||||
import { observer } from "mobx-react";
|
import { disposeOnUnmount, observer } from "mobx-react";
|
||||||
|
|
||||||
import { userStore } from "../../../common/user-store";
|
import { userStore } from "../../../common/user-store";
|
||||||
import { isWindows } from "../../../common/vars";
|
import { isWindows } from "../../../common/vars";
|
||||||
@ -31,12 +31,14 @@ export class Preferences extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
disposeOnUnmount(this, [
|
||||||
reaction(() => navigation.location.hash, hash => {
|
reaction(() => navigation.location.hash, hash => {
|
||||||
document.getElementById(hash.slice(1))?.scrollIntoView();
|
document.getElementById(hash.slice(1))?.scrollIntoView();
|
||||||
navigation.location.hash = "";
|
navigation.location.hash = "";
|
||||||
}, {
|
}, {
|
||||||
fireImmediately: true
|
fireImmediately: true
|
||||||
});
|
})
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user