mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
add test mode, update cm_test
This commit is contained in:
@@ -43,6 +43,9 @@ var version = "";
|
||||
int androidVersion = 0;
|
||||
DesktopType? desktopType;
|
||||
|
||||
/// * debug or test only, DO NOT enable in release build
|
||||
bool isTest = false;
|
||||
|
||||
typedef F = String Function(String);
|
||||
typedef FMethod = String Function(String, dynamic);
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ class ServerModel with ChangeNotifier {
|
||||
_serverId = IDTextEditingController(text: _emptyIdShow);
|
||||
|
||||
Timer.periodic(Duration(seconds: 1), (timer) async {
|
||||
if (isTest) return timer.cancel();
|
||||
var status = await bind.mainGetOnlineStatue();
|
||||
if (status > 0) {
|
||||
status = 1;
|
||||
@@ -343,6 +344,7 @@ class ServerModel with ChangeNotifier {
|
||||
|
||||
// force
|
||||
updateClientState([String? json]) async {
|
||||
if (isTest) return;
|
||||
var res = await bind.cmGetClientsState();
|
||||
try {
|
||||
final List clientsJson = jsonDecode(res);
|
||||
|
||||
Reference in New Issue
Block a user