🐛 Fix first time login did not connect to ws

🗑️ Remove next version notice
This commit is contained in:
2024-12-09 21:42:19 +08:00
parent 415446e3bb
commit 687db37daf
6 changed files with 16 additions and 13 deletions

View File

@ -11,6 +11,8 @@ import 'package:surface/types/auth.dart';
import 'package:surface/widgets/dialog.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../../providers/websocket.dart';
final Map<int, (String label, IconData icon, bool isOtp)> _factorLabelMap = {
0: ('authFactorPassword'.tr(), Symbols.password, false),
1: ('authFactorEmail'.tr(), Symbols.email, true),
@ -156,6 +158,9 @@ class _LoginCheckScreenState extends State<_LoginCheckScreen> {
final user = context.read<UserProvider>();
await user.refreshUser();
if (!mounted) return;
final ws = context.read<WebSocketProvider>();
await ws.connect();
if (!mounted) return;
Navigator.pop(context, true);
} catch (err) {
context.showErrorDialog(err);

View File

@ -64,16 +64,6 @@ class _HomeScreenState extends State<HomeScreen> {
: MainAxisAlignment.start,
children: [
if (constraints.maxWidth <= 640) const Gap(8),
Card(
child: ListTile(
isThreeLine: true,
leading: const Icon(Symbols.construction),
title: Text('nextVersionAlert').tr(),
subtitle: Text('nextVersionNotice').tr(),
contentPadding: const EdgeInsets.symmetric(
vertical: 8, horizontal: 16),
),
).padding(horizontal: 8),
_HomeDashSpecialDayWidget().padding(top: 8, horizontal: 8),
StaggeredGrid.count(
crossAxisCount: 2,