Refactor mobile to use OpenApi generated SDK (#336)

This commit is contained in:
Alex 2022-07-13 07:23:48 -05:00 committed by GitHub
parent d69470e207
commit ae7e582ec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
276 changed files with 14513 additions and 3003 deletions

View file

@ -19,10 +19,13 @@ class SplashScreenPage extends HookConsumerWidget {
Hive.box<HiveSavedLoginInfo>(hiveLoginInfoBox).get(savedLoginInfoKey);
void performLoggingIn() async {
var isAuthenticated = await ref
.read(authenticationProvider.notifier)
.login(
loginInfo!.email, loginInfo.password, loginInfo.serverUrl, true);
var isAuthenticated =
await ref.read(authenticationProvider.notifier).login(
loginInfo!.email,
loginInfo.password,
loginInfo.serverUrl,
true,
);
if (isAuthenticated) {
// Resume backup (if enable) then navigate
@ -33,14 +36,17 @@ class SplashScreenPage extends HookConsumerWidget {
}
}
useEffect(() {
if (loginInfo?.isSaveLogin == true) {
performLoggingIn();
} else {
AutoRouter.of(context).push(const LoginRoute());
}
return null;
}, []);
useEffect(
() {
if (loginInfo?.isSaveLogin == true) {
performLoggingIn();
} else {
AutoRouter.of(context).push(const LoginRoute());
}
return null;
},
[],
);
return Scaffold(
backgroundColor: immichBackgroundColor,