Merge pull request #5832 from dignow/fix/await_calling_order

use await to guarantee the calling order
This commit is contained in:
RustDesk 2023-09-27 10:03:41 +08:00 committed by GitHub
commit 3ed71fa21e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,11 +203,11 @@ class FfiModel with ChangeNotifier {
}, sessionId, peerId);
updatePrivacyMode(data.updatePrivacyMode, sessionId, peerId);
setConnectionType(peerId, data.secure, data.direct);
handlePeerInfo(data.peerInfo, peerId);
await handlePeerInfo(data.peerInfo, peerId);
for (var element in data.cursorDataList) {
handleCursorData(element);
await handleCursorData(element);
}
handleCursorId(data.lastCursorId);
await handleCursorId(data.lastCursorId);
}
// todo: why called by two position
@ -1802,7 +1802,7 @@ class FFI {
debugPrint('Unreachable, the cached data cannot be decoded.');
return;
}
ffiModel.handleCachedPeerData(data, id);
await ffiModel.handleCachedPeerData(data, id);
await bind.sessionRefresh(sessionId: sessionId);
});
isToNewWindowNotified.value = true;