From 9bd945f02bbd8bd45cd58db9822230825a54da78 Mon Sep 17 00:00:00 2001 From: octopusYan <935540320@qq.com> Date: Sat, 16 Apr 2022 12:31:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E7=BD=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../top/octopusyan/controller/MainController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/top/octopusyan/controller/MainController.java b/src/main/java/top/octopusyan/controller/MainController.java index 92d43ee..be4457b 100644 --- a/src/main/java/top/octopusyan/controller/MainController.java +++ b/src/main/java/top/octopusyan/controller/MainController.java @@ -348,13 +348,13 @@ public class MainController extends BaseController implements Initial serverProviderRBtn.setSelected(false); serverVisitorRBtn.setSelected(false); proxySetupModel.isProvider = null; - } else if (oldValue == null) { - if (proxySetupModel.isProvider == null) { - proxySetupModel.isProvider = proxySetupModel.isProvider(); - } - serverProviderRBtn.setSelected(proxySetupModel.isProvider); - serverVisitorRBtn.setSelected(!proxySetupModel.isProvider); + return; } + + boolean isProvider = newValue.equals("提供者"); + serverProviderRBtn.setSelected(isProvider); + serverVisitorRBtn.setSelected(!isProvider); + proxySetupModel.isProvider = isProvider; }); serverRoleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> { if (newValue == null) return;