Fix: fix the case mistake in config logic.

**Issue:**
When changing the mode, Clash server will return an error `{"message":"Body invalid"}`.

**Changes:**
According to the https://github.com/Dreamacro/clash/blob/master/tunnel/mode.go. Make first-letter uppercase to make the mode-changing work. Tested locally.
This commit is contained in:
Zhiyuan Zheng 2020-06-16 13:26:49 +08:00 committed by GitHub
parent 263a4335eb
commit c0adc3a792
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,15 +27,15 @@ const propsList = [{ id: 0 }, { id: 1 }, { id: 2 }, { id: 3 }];
const optionsRule = [ const optionsRule = [
{ {
label: 'Global', label: 'Global',
value: 'global', value: 'Global',
}, },
{ {
label: 'Rule', label: 'Rule',
value: 'rule', value: 'Rule',
}, },
{ {
label: 'Direct', label: 'Direct',
value: 'direct', value: 'Direct',
}, },
]; ];
@ -220,7 +220,7 @@ function ConfigImpl({
<ToggleSwitch <ToggleSwitch
options={optionsRule} options={optionsRule}
name="mode" name="mode"
value={configState.mode && configState.mode.toLowerCase()} value={configState.mode}
onChange={handleInputOnChange} onChange={handleInputOnChange}
/> />
</div> </div>