workaround for

This commit is contained in:
rustdesk 2023-03-23 22:52:58 +08:00
parent 6745492417
commit f05ac099e7

@ -535,11 +535,18 @@ class FfiModel with ChangeNotifier {
void setViewOnly(String id, bool value) { void setViewOnly(String id, bool value) {
if (version_cmp(_pi.version, '1.2.0') < 0) return; if (version_cmp(_pi.version, '1.2.0') < 0) return;
if (value) { // tmp fix for https://github.com/rustdesk/rustdesk/pull/3706#issuecomment-1481242389
ShowRemoteCursorState.find(id).value = value; // because below rx not used in mobile version, so not initialized, below code will cause crash
} else { // current our flutter code quality is fucking shit now. !!!!!!!!!!!!!!!!
ShowRemoteCursorState.find(id).value = try {
bind.sessionGetToggleOptionSync(id: id, arg: 'show-remote-cursor'); if (value) {
ShowRemoteCursorState.find(id).value = value;
} else {
ShowRemoteCursorState.find(id).value =
bind.sessionGetToggleOptionSync(id: id, arg: 'show-remote-cursor');
}
} catch (e) {
//
} }
if (_viewOnly != value) { if (_viewOnly != value) {
_viewOnly = value; _viewOnly = value;