WIP
This commit is contained in:
parent
7aac65b289
commit
810c4f4b5f
|
@ -6,8 +6,6 @@ import 'dart:developer';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/modules/index.dart';
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||||
import 'package:hub/shared/helpers/database/database_helper.dart';
|
|
||||||
|
|
||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
|
||||||
abstract class LicenseRemoteDataSource {
|
abstract class LicenseRemoteDataSource {
|
||||||
|
@ -96,7 +94,7 @@ class LicenseRemoteDataSourceImpl implements LicenseRemoteDataSource {
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
log('Erro ao obter licenças: $e', stackTrace: s);
|
log('Erro ao obter licenças: $e', stackTrace: s);
|
||||||
// return await setupLicense(DatabaseStorage.database, isNewVersion);
|
// return await setupLicense(DatabaseStorage.database, isNewVersion);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,10 @@ class LicenseRepositoryImpl implements LicenseRepository {
|
||||||
log('updateLicense');
|
log('updateLicense');
|
||||||
bool result = false;
|
bool result = false;
|
||||||
final bool isNewVersion = await localDataSource.isNewVersion();
|
final bool isNewVersion = await localDataSource.isNewVersion();
|
||||||
result = await remoteDataSource.setupLicense(database, isNewVersion);
|
|
||||||
if (isNewVersion) {
|
if (isNewVersion) {
|
||||||
result = await remoteDataSource.fetchLicenses(isNewVersion);
|
result = await remoteDataSource.fetchLicenses(isNewVersion);
|
||||||
|
} else {
|
||||||
|
result = await remoteDataSource.setupLicense(database, isNewVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue