mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 22:11:30 +08:00
require login for note (#13775)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -566,6 +566,13 @@ class _GeneralState extends State<_General> {
|
||||
'note-at-conn-end-tip',
|
||||
kOptionAllowAskForNoteAtEndOfConnection,
|
||||
isServer: false,
|
||||
optSetter: (key, value) async {
|
||||
if (value && !gFFI.userModel.isLogin) {
|
||||
final res = await loginDialog();
|
||||
if (res != true) return;
|
||||
}
|
||||
await mainSetLocalBoolOption(key, value);
|
||||
},
|
||||
));
|
||||
return _Card(title: 'Other', children: children);
|
||||
}
|
||||
|
||||
@@ -790,6 +790,10 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
||||
title: Text(translate('note-at-conn-end-tip')),
|
||||
initialValue: _allowAskForNoteAtEndOfConnection,
|
||||
onToggle: (v) async {
|
||||
if (v && !gFFI.userModel.isLogin) {
|
||||
final res = await loginDialog();
|
||||
if (res != true) return;
|
||||
}
|
||||
await mainSetLocalBoolOption(
|
||||
kOptionAllowAskForNoteAtEndOfConnection, v);
|
||||
final newValue = mainGetLocalBoolOptionSync(
|
||||
|
||||
@@ -1081,7 +1081,8 @@ class FfiModel with ChangeNotifier {
|
||||
if (displays.length == 1) {
|
||||
bind.sessionSetSize(
|
||||
sessionId: sessionId,
|
||||
display: pi.currentDisplay == kAllDisplayValue ? 0 : pi.currentDisplay,
|
||||
display:
|
||||
pi.currentDisplay == kAllDisplayValue ? 0 : pi.currentDisplay,
|
||||
width: displays[0].width,
|
||||
height: displays[0].height,
|
||||
);
|
||||
@@ -1100,6 +1101,11 @@ class FfiModel with ChangeNotifier {
|
||||
|
||||
void _queryAuditGuid(String peerId) async {
|
||||
try {
|
||||
if (bind
|
||||
.sessionGetAuditServerSync(sessionId: sessionId, typ: "conn/active")
|
||||
.isEmpty) {
|
||||
return;
|
||||
}
|
||||
if (!mainGetLocalBoolOptionSync(
|
||||
kOptionAllowAskForNoteAtEndOfConnection)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user