diff options
| author | Haishan <[email protected]> | 2020-09-13 16:34:18 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2020-09-13 17:16:14 +0800 |
| commit | 15bc0f69a8367a57fa1bf263e615285349ad4ab9 (patch) | |
| tree | fbdd2a46303703822f7e7bc3462a70b4855fe4a1 /src/components/Config.js | |
| parent | a8f0d3d4b4928caebf61c75fa9191a170b471035 (diff) | |
feat: multi backends management
Diffstat (limited to 'src/components/Config.js')
| -rw-r--r-- | src/components/Config.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/Config.js b/src/components/Config.js index d5850d1..f14f7d9 100644 --- a/src/components/Config.js +++ b/src/components/Config.js @@ -2,12 +2,12 @@ import PropTypes from 'prop-types'; import React from 'react'; import { - clearStorage, getClashAPIConfig, getLatencyTestUrl, getSelectedChartStyleIndex, } from '../store/app'; import { fetchConfigs, getConfigs, updateConfigs } from '../store/configs'; +import { openModal } from '../store/modals'; import Button from './Button'; import s0 from './Config.module.css'; import ContentHeader from './ContentHeader'; @@ -104,6 +104,10 @@ function ConfigImpl({ refConfigs.current = configs; }, [configs]); + const openAPIConfigModal = useCallback(() => { + dispatch(openModal('apiConfig')); + }, [dispatch]); + const setConfigState = useCallback( (name, val) => { setConfigStateInternal({ @@ -256,7 +260,7 @@ function ConfigImpl({ </div> <div> <div className={s0.label}>Action</div> - <Button label="Log out" onClick={clearStorage} /> + <Button label="Switch backend" onClick={openAPIConfigModal} /> </div> </div> </div> |
