* chore: move over all fluffychat copy changes, revert any differenced between FluffyChat and Pangea copy * chore: sort copy between FluffyChat and Pangea, update metadata types for FluffyChat copy * chore: update metadata type for pangea chat copy * chore: add placeholders to Pangea vietnamese copy
34 lines
1.1 KiB
Dart
34 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
import 'package:fluffychat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.dart';
|
|
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
|
import 'package:fluffychat/widgets/matrix.dart';
|
|
|
|
void pLogoutAction(BuildContext context, {bool? isDestructiveAction}) async {
|
|
if (await showOkCancelAlertDialog(
|
|
useRootNavigator: false,
|
|
context: context,
|
|
title: L10n.of(context).areYouSureYouWantToLogout,
|
|
// #Pangea
|
|
// message: L10n.of(context).noBackupWarning,
|
|
message: L10n.of(context).dontForgetPassword,
|
|
// Pangea#
|
|
okLabel: L10n.of(context).logout,
|
|
cancelLabel: L10n.of(context).cancel,
|
|
) ==
|
|
OkCancelResult.cancel) {
|
|
return;
|
|
}
|
|
final matrix = Matrix.of(context);
|
|
|
|
// before wiping out locally cached construct data, save it to the server
|
|
await MatrixState.pangeaController.putAnalytics
|
|
.sendLocalAnalyticsToAnalyticsRoom(onLogout: true);
|
|
|
|
await showFutureLoadingDialog(
|
|
context: context,
|
|
future: () => matrix.client.logout(),
|
|
);
|
|
}
|