summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorMetaCubeX <[email protected]>2022-05-29 20:03:19 +0800
committerMetaCubeX <[email protected]>2022-05-29 20:03:19 +0800
commit32684f75b12dc67976b7694b0081c58034c19fca (patch)
treedebd1e6e00cf430b30ff945f8aab22bff62d1caf /src/components
parentc4601a85ae5da11e481d3b46cd3424b058b13e60 (diff)
fix: type tun undefined
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Config.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/Config.tsx b/src/components/Config.tsx
index a8438c1..9b95cfa 100644
--- a/src/components/Config.tsx
+++ b/src/components/Config.tsx
@@ -214,6 +214,10 @@ function ConfigImpl({
const { t, i18n } = useTranslation();
+ // @ts-ignore
+ // @ts-ignore
+ // @ts-ignore
+ // @ts-ignore
return (
<div>
<ContentHeader title={t('Config')} />
@@ -291,7 +295,7 @@ function ConfigImpl({
<div className={s0.label}>{t('enable_tun_device')}</div>
<div className={s0.wrapSwitch}>
<Switch
- checked={configState['tun']['enable']}
+ checked={configState['tun']?.enable}
onChange={(value: boolean) =>
handleChangeValue({ name: 'enable', value: value })
}
@@ -303,7 +307,7 @@ function ConfigImpl({
<div className={s0.label}>TUN IP Stack</div>
<Select
options={tunStackOptions}
- selected={configState['tun']['stack']}
+ selected={configState['tun']?.stack}
onChange={(e) =>
handleChangeValue({ name: 'stack', value: e.target.value })
}