refact: custom client, remove enable-check-update (#8092)

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2024-05-19 16:32:15 +08:00
committed by GitHub
parent 3c502c6fc2
commit 986b9fb0e0
4 changed files with 19 additions and 15 deletions

View File

@@ -658,10 +658,12 @@ class _DesktopHomePageState extends State<DesktopHomePage>
@override
void initState() {
super.initState();
Timer(const Duration(seconds: 1), () async {
updateUrl = await bind.mainGetSoftwareUpdateUrl();
if (updateUrl.isNotEmpty) setState(() {});
});
if (!bind.isCustomClient()) {
Timer(const Duration(seconds: 1), () async {
updateUrl = await bind.mainGetSoftwareUpdateUrl();
if (updateUrl.isNotEmpty) setState(() {});
});
}
_updateTimer = periodic_immediate(const Duration(seconds: 1), () async {
await gFFI.serverModel.fetchID();
final error = await bind.mainGetError();

View File

@@ -392,12 +392,13 @@ class _GeneralState extends State<_General> {
child: _OptionCheckBox(context, "Always use software rendering",
kOptionAllowAlwaysSoftwareRender),
),
_OptionCheckBox(
context,
'Check for software update on startup',
kOptionEnableCheckUpdate,
isServer: false,
)
if (!bind.isCustomClient())
_OptionCheckBox(
context,
'Check for software update on startup',
kOptionEnableCheckUpdate,
isServer: false,
)
],
];
if (bind.mainShowOption(key: kOptionAllowLinuxHeadless)) {

View File

@@ -65,10 +65,12 @@ class _ConnectionPageState extends State<ConnectionPage> {
}();
}
if (isAndroid) {
Timer(const Duration(seconds: 1), () async {
_updateUrl = await bind.mainGetSoftwareUpdateUrl();
if (_updateUrl.isNotEmpty) setState(() {});
});
if (!bind.isCustomClient()) {
Timer(const Duration(seconds: 1), () async {
_updateUrl = await bind.mainGetSoftwareUpdateUrl();
if (_updateUrl.isNotEmpty) setState(() {});
});
}
}
_idController.addListener(() {