瀏覽代碼

Minor changes

ashilkn 2 年之前
父節點
當前提交
d11e56b931
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 2 1
      lib/services/user_service.dart
  2. 1 1
      lib/ui/settings/account_section_widget.dart

+ 2 - 1
lib/services/user_service.dart

@@ -198,7 +198,6 @@ class UserService {
 
   Future<void> logout(BuildContext context) async {
     try {
-      await Future.delayed(const Duration(seconds: 3));
       final response = await _enteDio.post("/users/logout");
       if (response.statusCode == 200) {
         await Configuration.instance.logout();
@@ -208,6 +207,8 @@ class UserService {
       }
     } catch (e) {
       _logger.severe(e);
+      //This future is for waiting for the dialog from which logout() is called
+      //to close and only then to show the error dialog.
       Future.delayed(
         const Duration(milliseconds: 150),
         () => showGenericErrorDialog(context: context),

+ 1 - 1
lib/ui/settings/account_section_widget.dart

@@ -155,7 +155,7 @@ class AccountSectionWidget extends StatelessWidget {
     );
   }
 
-  Future<void> _onLogoutTapped(BuildContext context) async {
+  void _onLogoutTapped(BuildContext context) {
     showChoiceActionSheet(
       context,
       title: "Are you sure you want to logout?",