More background refreshing
This commit is contained in:
@@ -118,7 +118,6 @@ class AppAuth extends ChangeNotifier implements TokenSource {
|
||||
final user = await APIClient.getUser(this, _userID!);
|
||||
|
||||
_user = user;
|
||||
notifyListeners();
|
||||
|
||||
await save();
|
||||
|
||||
@@ -142,14 +141,12 @@ class AppAuth extends ChangeNotifier implements TokenSource {
|
||||
final client = await APIClient.getClient(this, _clientID!);
|
||||
|
||||
_client = client;
|
||||
notifyListeners();
|
||||
|
||||
await save();
|
||||
|
||||
return client;
|
||||
} on APIException catch (_) {
|
||||
_client = null;
|
||||
notifyListeners();
|
||||
return null;
|
||||
} catch (exc) {
|
||||
_client = null;
|
||||
|
@@ -5,6 +5,8 @@ import 'package:xid/xid.dart';
|
||||
part 'application_log.g.dart';
|
||||
|
||||
class ApplicationLog {
|
||||
//TODO max size, auto clear old
|
||||
|
||||
static void debug(String message, {String? additional, StackTrace? trace}) {
|
||||
(additional != null && additional != '') ? print('[DEBUG] ${message}: ${additional}') : print('[DEBUG] ${message}');
|
||||
|
||||
|
@@ -6,6 +6,8 @@ import 'package:xid/xid.dart';
|
||||
part 'request_log.g.dart';
|
||||
|
||||
class RequestLog {
|
||||
//TODO max size, auto clear old
|
||||
|
||||
static void addRequestException(String name, DateTime tStart, String method, Uri uri, String reqbody, Map<String, String> reqheaders, dynamic e, StackTrace trace) {
|
||||
Hive.box<SCNRequest>('scn-requests').add(SCNRequest(
|
||||
id: Xid().toString(),
|
||||
|
Reference in New Issue
Block a user