fix: handle login

This commit is contained in:
shenlong-tanwen
2024-08-25 10:38:24 +05:30
parent 7f83740b35
commit 877c3b028b
27 changed files with 430 additions and 355 deletions
@@ -1,10 +1,11 @@
import 'package:immich_mobile/domain/models/server-info/server_config.model.dart';
import 'package:immich_mobile/domain/models/server-info/server_features.model.dart';
import 'package:immich_mobile/utils/immich_api_client.dart';
import 'package:immich_mobile/utils/mixins/log_context.mixin.dart';
import 'package:openapi/openapi.dart';
import 'package:openapi/api.dart';
class ServerInfoService with LogContext {
final Openapi _api;
final ImmichApiClient _api;
ServerApi get _serverInfo => _api.getServerApi();
@@ -12,8 +13,7 @@ class ServerInfoService with LogContext {
Future<ServerFeatures?> getServerFeatures() async {
try {
final response = await _serverInfo.getServerFeatures();
final dto = response.data;
final dto = await _serverInfo.getServerFeatures();
if (dto != null) {
return ServerFeatures.fromDto(dto);
}
@@ -25,8 +25,7 @@ class ServerInfoService with LogContext {
Future<ServerConfig?> getServerConfig() async {
try {
final response = await _serverInfo.getServerConfig();
final dto = response.data;
final dto = await _serverInfo.getServerConfig();
if (dto != null) {
return ServerConfig.fromDto(dto);
}