Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-audi committed Sep 24, 2021
2 parents 52b80f9 + c9f5ad8 commit 03058cc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
7 changes: 6 additions & 1 deletion lib/src/slices/api_app_data/api_app_data_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class ApiAppDataService {
: await _repository.update(dataToInsert);
}

Future<void> delete(ApiAppDataKey key) async {
ApiAppDataModel? data = await this.getByKey(key);
if (data != null) await _repository.delete(data.id!);
}

Future<void> logout() async {
List<ApiAppDataKey> keysToDelete = [
ApiAppDataKey.userReferCode,
Expand All @@ -31,7 +36,7 @@ class ApiAppDataService {
ApiAppDataKey.emailIndexPage,
];
keysToDelete.forEach((key) async {
await _repository.deleteByKey(key);
await _repository.deleteByKey(key.value!);
});
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:sqflite_sqlcipher/sqlite_api.dart';

import '../api_app_data_key.dart';
import '../model/api_app_data_model.dart';

class ApiAppDataRepository {
Expand Down Expand Up @@ -47,7 +46,7 @@ class ApiAppDataRepository {
return ApiAppDataModel.fromMap(rows[0]);
}

deleteByKey(ApiAppDataKey key) async {
deleteByKey(String key) async {
await _database.delete(_table, where: "key = ?", whereArgs: [key]);
}
}
4 changes: 4 additions & 0 deletions lib/src/slices/api_oauth/api_oauth_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import 'dart:convert';

import 'package:app/src/slices/api_app_data/api_app_data_key.dart';
import 'package:app/src/slices/api_oauth/model/api_oauth_model.dart';
import 'package:flutter_appauth/flutter_appauth.dart';
import 'package:http/http.dart';
Expand Down Expand Up @@ -77,6 +78,9 @@ class ApiOAuthService {
_model.interfaceProviders[account.provider];
if (provider != null) await provider.revokeToken(account);
await _apiAuthRepositoryAccount.delete(account);
await _apiAppDataService.delete(ApiAppDataKey.emailIndexEpoch);
await _apiAppDataService.delete(ApiAppDataKey.emailIndexPage);
await _apiAppDataService.delete(ApiAppDataKey.emailIndexLabel);
}

Future<Map?> getUserInfo(
Expand Down
10 changes: 5 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ packages:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.2"
version: "1.7.1"
android_intent:
dependency: "direct main"
description:
Expand Down Expand Up @@ -56,7 +56,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.1"
version: "2.6.1"
barcode_scan2:
dependency: "direct main"
description:
Expand Down Expand Up @@ -147,7 +147,7 @@ packages:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.2.0"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -496,7 +496,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.3.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -881,7 +881,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
version: "0.3.0"
time:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: app
description: It's your data. Take back control.
version: 0.2.5+1
version: 0.2.5+5
publish_to: 'none'

environment:
Expand Down

0 comments on commit 03058cc

Please sign in to comment.