Compare commits

...

2 Commits

Author SHA1 Message Date
f3b7b02e77 🐛 Clean up local stuff when logout 2024-12-09 21:47:27 +08:00
687db37daf 🐛 Fix first time login did not connect to ws
🗑️ Remove next version notice
2024-12-09 21:42:19 +08:00
7 changed files with 22 additions and 13 deletions

View File

@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<application
android:label="Solian"
@ -55,4 +56,4 @@
<data android:mimeType="text/plain" />
</intent>
</queries>
</manifest>
</manifest>

View File

@ -1,6 +1,4 @@
{
"nextVersionAlert": "高强度开发提示",
"nextVersionNotice": "您正在使用的是 Solian 2.0 的抢先体验版本目前稳定分支sn.solsynth.dev版本为 1.4。该版本还在持续的开发中,部分功能可能不稳定,也并非所有功能都支持了。您可以通过 TestFlight 回滚到 1.4.X 或者继续体验新版本sn-next.solsynth.dev。",
"screen": "页面",
"screenAbout": "关于",
"screenHome": "首页",

View File

@ -2,11 +2,13 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:hive/hive.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:provider/provider.dart';
import 'package:styled_widget/styled_widget.dart';
import 'package:surface/providers/sn_network.dart';
import 'package:surface/providers/userinfo.dart';
import 'package:surface/providers/websocket.dart';
import 'package:surface/widgets/account/account_image.dart';
import 'package:surface/widgets/app_bar_leading.dart';
import 'package:surface/widgets/dialog.dart';
@ -123,7 +125,11 @@ class _AuthorizedAccountScreen extends StatelessWidget {
'accountLogoutConfirm'.tr(),
)
.then((value) {
if(!context.mounted) return;
if (value) ua.logoutUser();
final ws = context.read<WebSocketProvider>();
ws.disconnect();
Hive.deleteFromDisk();
});
},
),

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,

View File

@ -1522,6 +1522,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.3"
screenshot:
dependency: "direct main"
description:
name: screenshot
sha256: "63817697a7835e6ce82add4228e15d233b74d42975c143ad8cfe07009fab866b"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
sdp_transform:
dependency: transitive
description:

View File

@ -100,6 +100,7 @@ dependencies:
email_validator: ^3.0.0
package_info_plus: ^8.1.1
intl: ^0.19.0
screenshot: ^3.0.0
dev_dependencies:
flutter_test: