mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 07:43:01 +08:00
flutter_desktop: remove unnecessary control flow
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
7a2de5d280
commit
0488eb31f5
@ -47,7 +47,7 @@ class AbModel with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<String> getApiServer() async {
|
||||
return await bind.mainGetApiServer() ?? "";
|
||||
return await bind.mainGetApiServer();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
|
@ -293,13 +293,11 @@ class FileModel extends ChangeNotifier {
|
||||
_localOption.home = _ffi.target?.getByName("get_home_dir") ?? "";
|
||||
_localOption.showHidden = (await bind.sessionGetPeerOption(
|
||||
id: _ffi.target?.id ?? "", name: "local_show_hidden"))
|
||||
?.isNotEmpty ??
|
||||
false;
|
||||
.isNotEmpty;
|
||||
|
||||
_remoteOption.showHidden = (await bind.sessionGetPeerOption(
|
||||
id: _ffi.target?.id ?? "", name: "remote_show_hidden"))
|
||||
?.isNotEmpty ??
|
||||
false;
|
||||
.isNotEmpty;
|
||||
_remoteOption.isWindows = _ffi.target?.ffiModel.pi.platform == "Windows";
|
||||
|
||||
debugPrint("remote platform: ${_ffi.target?.ffiModel.pi.platform}");
|
||||
@ -307,11 +305,9 @@ class FileModel extends ChangeNotifier {
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
|
||||
final local = (await bind.sessionGetPeerOption(
|
||||
id: _ffi.target?.id ?? "", name: "local_dir")) ??
|
||||
"";
|
||||
id: _ffi.target?.id ?? "", name: "local_dir"));
|
||||
final remote = (await bind.sessionGetPeerOption(
|
||||
id: _ffi.target?.id ?? "", name: "remote_dir")) ??
|
||||
"";
|
||||
id: _ffi.target?.id ?? "", name: "remote_dir"));
|
||||
openDirectory(local.isEmpty ? _localOption.home : local, isLocal: true);
|
||||
openDirectory(remote.isEmpty ? _remoteOption.home : remote, isLocal: false);
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
|
@ -18,7 +18,7 @@ class UserModel extends ChangeNotifier {
|
||||
if (userName.isNotEmpty) {
|
||||
return userName.value;
|
||||
}
|
||||
final userInfo = await bind.mainGetLocalOption(key: 'user_info') ?? "{}";
|
||||
final userInfo = await bind.mainGetLocalOption(key: 'user_info');
|
||||
if (userInfo.trim().isEmpty) {
|
||||
return "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user