Skip to content

Commit

Permalink
[Encrypted] Try to upload key to server before logout
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdat committed Feb 7, 2025
1 parent 769b409 commit 3846920
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/pages/settings_dashboard/settings/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,27 @@ class SettingsController extends State<Settings> with ConnectPageMixin {
ConfirmResult.cancel) {
return;
}

await _tryToUploadKeyBackup();

if (PlatformInfos.isMobile) {
await _logoutActionsOnMobile();
} else {
await _logoutActions();
}
}

Future<void> _tryToUploadKeyBackup() async {
await TwakeDialog.showFutureLoadingDialogFullScreen(
future: () async {
print('datph tryToUploadKeyBackup client = ${matrix.client} - encryption = ${matrix.client.encryption}');
await matrix.client.encryption?.keyManager.uploadInboundGroupSessions();
},
);

return;
}

Future<void> _logoutActionsOnMobile() async {
try {
await tryLogoutSso(context);
Expand Down

0 comments on commit 3846920

Please sign in to comment.