From 80d4e18a2391e29abae3c7ae21cb3f6975458400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Sun, 20 Oct 2024 03:22:39 +0200 Subject: [PATCH] bugfixes --- flutter/Makefile | 2 +- flutter/TODO.md | 2 ++ flutter/lib/models/sender_name_statistics.dart | 12 ++++++------ flutter/lib/pages/account/login.dart | 12 +++++++----- flutter/lib/pages/debug/debug_actions.dart | 13 ------------- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/flutter/Makefile b/flutter/Makefile index 2785d5a..792d371 100644 --- a/flutter/Makefile +++ b/flutter/Makefile @@ -21,7 +21,7 @@ run-android: install-release: # Install on Pixel 7a flutter build apk --release - flutter install --release -d 35221JEHN07157 + flutter run --release -d 35221JEHN07157 build-release: flutter build apk --release diff --git a/flutter/TODO.md b/flutter/TODO.md index e35accc..e8ff65c 100644 --- a/flutter/TODO.md +++ b/flutter/TODO.md @@ -25,6 +25,8 @@ - [ ] Still @ERROR on scn-init, but no logs? - better persist error (write in SharedPrefs at error_$date=txt ?), also perhaps print first error line in scn-init notification? + - [ ] fix time format (in message-list, in card, top right) - midnight is shown as "24:05" instead of "00:05" - thats weird + ----- # TODO iOS specific diff --git a/flutter/lib/models/sender_name_statistics.dart b/flutter/lib/models/sender_name_statistics.dart index 744299d..e4c2886 100644 --- a/flutter/lib/models/sender_name_statistics.dart +++ b/flutter/lib/models/sender_name_statistics.dart @@ -1,21 +1,21 @@ class SenderNameStatistics { final String name; - final String ts_last; - final String ts_first; + final String lastTimestamp; + final String firstTimestamp; final int count; const SenderNameStatistics({ required this.name, - required this.ts_last, - required this.ts_first, + required this.lastTimestamp, + required this.firstTimestamp, required this.count, }); factory SenderNameStatistics.fromJson(Map json) { return SenderNameStatistics( name: json['name'] as String, - ts_last: json['ts_last'] as String, - ts_first: json['ts_first'] as String, + lastTimestamp: json['last_timestamp'] as String, + firstTimestamp: json['first_timestamp'] as String, count: json['count'] as int, ); } diff --git a/flutter/lib/pages/account/login.dart b/flutter/lib/pages/account/login.dart index 9d9f76d..e4534b4 100644 --- a/flutter/lib/pages/account/login.dart +++ b/flutter/lib/pages/account/login.dart @@ -140,13 +140,15 @@ class _AccountLoginPageState extends State { return; } - final toks = await APIClient.getKeyTokenByToken(uid, stokv); + if (stokv != "") { + final toks = await APIClient.getKeyTokenByToken(uid, stokv); - if (!toks.allChannels || toks.permissions != 'CS') { - Toaster.error("Error", 'Send token does not have required permissions'); - return; + if (!toks.allChannels || toks.permissions != 'CS') { + Toaster.error("Error", 'Send token does not have required permissions'); + return; + } } - + final user = await APIClient.getUser(DirectTokenSource(uid, atokv), uid); final client = await APIClient.addClient(DirectTokenSource(uid, atokv), fcmToken, Globals().deviceModel, Globals().version, Globals().hostname, Globals().clientType); diff --git a/flutter/lib/pages/debug/debug_actions.dart b/flutter/lib/pages/debug/debug_actions.dart index a997cc1..695532f 100644 --- a/flutter/lib/pages/debug/debug_actions.dart +++ b/flutter/lib/pages/debug/debug_actions.dart @@ -60,19 +60,6 @@ class _DebugActionsPageState extends State { onPressed: () => Notifier.showLocalNotification('', 'TEST_CHANNEL', "Test Channel", "Channel for testing", "Hello World", "Local Notification test", null), text: 'Show local notification', ), - SizedBox(height: 20), - UI.button( - big: false, - onPressed: () => ApplicationLog.writeRawFailure('test', { - 'text': "hello world", - 'object': { - 1: 2, - 4: 5, - 6: [7, 8, 9] - }, - 'trace': StackTrace.current - }), - text: 'asdf'), ], ), ),