mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-10-08 09:01:19 +02:00
Message notifications working
This commit is contained in:
1 parent
bc03dcbe89
commit
c4d9cd7986
15 files changed
+230
-16
No files matched your search
@@ -51,7 +51,7 @@ class AuthService {
|
||||
_helper = OAuth2Helper(
|
||||
client,
|
||||
clientId: clientId,
|
||||
scopes: ['read_prefs', 'write_api'],
|
||||
scopes: ['read_prefs', 'write_api', 'consume_messages'],
|
||||
enablePKCE: true,
|
||||
// tokenStorageKey: _tokenKey, // not supported by this package version
|
||||
);
|
||||
|
||||
@@ -55,8 +55,11 @@ class OSMMessagesService {
|
||||
final messages = user['messages'];
|
||||
if (messages == null) return null;
|
||||
|
||||
// Get unread count
|
||||
final unreadCount = messages['unread']?['count'] ?? 0;
|
||||
// Get unread count from correct path: messages.received.unread
|
||||
final received = messages['received'];
|
||||
if (received == null) return null;
|
||||
|
||||
final unreadCount = received['unread'] ?? 0;
|
||||
|
||||
// Update cache
|
||||
_lastCheck = DateTime.now();
|
||||
|
||||
Reference in new issue
Block a user