fix: prevent native settings being opened on non-native

fixes #344
This commit is contained in:
Paul
2021-11-14 18:51:19 +00:00
parent 9403707ba3
commit 9d64d25f4c
2 changed files with 12 additions and 6 deletions

View File

@@ -4,6 +4,9 @@ import Button from "../../../components/ui/Button";
import Checkbox from "../../../components/ui/Checkbox";
export function Native() {
if (typeof window.native === "undefined") return null;
/* eslint-disable react-hooks/rules-of-hooks */
const [config, setConfig] = useState(window.native.getConfig());
const [autoStart, setAutoStart] = useState<boolean | undefined>();
const fetchValue = () => window.native.getAutoStart().then(setAutoStart);