mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
fix: bio auth (#482)
This commit is contained in:
@@ -78,11 +78,7 @@ class _HomePageState extends State<HomePage>
|
||||
|
||||
switch (state) {
|
||||
case AppLifecycleState.resumed:
|
||||
if (_shouldAuth) {
|
||||
if (Stores.setting.useBioAuth.fetch()) {
|
||||
BioAuth.go().then((_) => _shouldAuth = false);
|
||||
}
|
||||
}
|
||||
if (_shouldAuth) _goAuth();
|
||||
if (!Pros.server.isAutoRefreshOn) {
|
||||
Pros.server.startAutoRefresh();
|
||||
}
|
||||
@@ -323,7 +319,7 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
|
||||
@override
|
||||
Future<void> afterFirstLayout(BuildContext context) async {
|
||||
// Auth required for first launch
|
||||
if (Stores.setting.useBioAuth.fetch()) BioAuth.go();
|
||||
_goAuth();
|
||||
|
||||
//_reqNotiPerm();
|
||||
|
||||
@@ -361,6 +357,15 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
|
||||
// }
|
||||
// }
|
||||
|
||||
void _goAuth() {
|
||||
if (Stores.setting.useBioAuth.fetch()) {
|
||||
if (BioAuthPage.route.isAlreadyIn) return;
|
||||
BioAuthPage.route.go(context, args: BioAuthPageArgs(
|
||||
onAuthSuccess: () => _shouldAuth = false,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onLongPressSetting() async {
|
||||
final map = Stores.setting.box.toJson(includeInternal: false);
|
||||
final keys = map.keys;
|
||||
|
||||
Reference in New Issue
Block a user