Skip to content

Commit

Permalink
refact: custom client, remove enable-check-update (#8092)
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <shuanglongchen@yeah.net>
  • Loading branch information
fufesou committed May 19, 2024
1 parent 3c502c6 commit 986b9fb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
10 changes: 6 additions & 4 deletions flutter/lib/desktop/pages/desktop_home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
13 changes: 7 additions & 6 deletions flutter/lib/desktop/pages/desktop_setting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
10 changes: 6 additions & 4 deletions flutter/lib/mobile/pages/connection_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(() {
Expand Down
1 change: 0 additions & 1 deletion libs/hbb_common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,6 @@ pub mod keys {
OPTION_LANGUAGE,
OPTION_ENABLE_CONFIRM_CLOSING_TABS,
OPTION_ENABLE_OPEN_NEW_CONNECTIONS_IN_TABS,
OPTION_ENABLE_CHECK_UPDATE,
OPTION_SYNC_AB_WITH_RECENT_SESSIONS,
OPTION_SYNC_AB_TAGS,
OPTION_FILTER_AB_BY_INTERSECTION,
Expand Down

0 comments on commit 986b9fb

Please sign in to comment.