mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -675,3 +675,22 @@ Future<bool?> verificationCodeDialog(UserPayload? user) async {
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void logOutConfirmDialog() {
|
||||
gFFI.dialogManager.show((setState, close, context) {
|
||||
submit() {
|
||||
close();
|
||||
gFFI.userModel.logOut();
|
||||
}
|
||||
|
||||
return CustomAlertDialog(
|
||||
content: Text(translate("logout_tip")),
|
||||
actions: [
|
||||
dialogButton(translate("Cancel"), onPressed: close, isOutline: true),
|
||||
dialogButton(translate("OK"), onPressed: submit),
|
||||
],
|
||||
onSubmit: submit,
|
||||
onCancel: close,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1385,7 +1385,7 @@ class _AccountState extends State<_Account> {
|
||||
() => {
|
||||
gFFI.userModel.userName.value.isEmpty
|
||||
? loginDialog()
|
||||
: gFFI.userModel.logOut()
|
||||
: logOutConfirmDialog()
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -1503,7 +1503,7 @@ class _PluginState extends State<_Plugin> {
|
||||
() => {
|
||||
gFFI.userModel.userName.value.isEmpty
|
||||
? loginDialog()
|
||||
: gFFI.userModel.logOut()
|
||||
: logOutConfirmDialog()
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ class _WebMenuState extends State<WebMenu> {
|
||||
if (gFFI.userModel.userName.value.isEmpty) {
|
||||
loginDialog();
|
||||
} else {
|
||||
gFFI.userModel.logOut();
|
||||
logOutConfirmDialog();
|
||||
}
|
||||
}
|
||||
if (value == 'scan') {
|
||||
|
||||
@@ -392,7 +392,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
||||
if (gFFI.userModel.userName.value.isEmpty) {
|
||||
loginDialog();
|
||||
} else {
|
||||
gFFI.userModel.logOut();
|
||||
logOutConfirmDialog();
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user