Merge pull request #5550 from 21pages/ios_1.2.2

Ios 1.2.2 waitForImage and login menu
This commit is contained in:
RustDesk 2023-08-30 20:01:41 +08:00 committed by GitHub
commit ab48ae6ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 29 deletions

View File

@ -211,25 +211,6 @@ class WebMenu extends StatefulWidget {
} }
class _WebMenuState extends State<WebMenu> { class _WebMenuState extends State<WebMenu> {
String url = "";
@override
void initState() {
super.initState();
() async {
final urlRes = await bind.mainGetApiServer();
var update = false;
if (urlRes != url) {
url = urlRes;
update = true;
}
if (update) {
setState(() {});
}
}();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Provider.of<FfiModel>(context); Provider.of<FfiModel>(context);
@ -251,16 +232,14 @@ class _WebMenuState extends State<WebMenu> {
child: Text(translate('ID/Relay Server')), child: Text(translate('ID/Relay Server')),
) )
] + ] +
(url.contains('admin.rustdesk.com') [
? <PopupMenuItem<String>>[] PopupMenuItem(
: [ value: "login",
PopupMenuItem( child: Text(gFFI.userModel.userName.value.isEmpty
value: "login", ? translate("Login")
child: Text(gFFI.userModel.userName.value.isEmpty : '${translate("Logout")} (${gFFI.userModel.userName.value})'),
? translate("Login") )
: '${translate("Logout")} (${gFFI.userModel.userName.value})'), ] +
)
]) +
[ [
PopupMenuItem( PopupMenuItem(
value: "about", value: "about",

View File

@ -1623,6 +1623,12 @@ class FFI {
elevationModel = ElevationModel(WeakReference(this)); elevationModel = ElevationModel(WeakReference(this));
} }
/// Mobile reuse FFI
void mobileReset() {
_waitForImageDialogShow.clear();
_waitForFirstImage.clear();
}
/// Start with the given [id]. Only transfer file if [isFileTransfer], only port forward if [isPortForward]. /// Start with the given [id]. Only transfer file if [isFileTransfer], only port forward if [isPortForward].
void start(String id, void start(String id,
{bool isFileTransfer = false, {bool isFileTransfer = false,
@ -1633,6 +1639,7 @@ class FFI {
bool? forceRelay}) { bool? forceRelay}) {
closed = false; closed = false;
auditNote = ''; auditNote = '';
if (isMobile) mobileReset();
assert(!(isFileTransfer && isPortForward), 'more than one connect type'); assert(!(isFileTransfer && isPortForward), 'more than one connect type');
if (isFileTransfer) { if (isFileTransfer) {
connType = ConnType.fileTransfer; connType = ConnType.fileTransfer;