mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +01:00
fix: Clearing push triggered when only one room got seen
This commit is contained in:
parent
dfd9106e56
commit
fe2aea6d3c
@ -38,7 +38,6 @@ void main() async {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final clients = await ClientManager.getClients();
|
final clients = await ClientManager.getClients();
|
||||||
Logs().level = kReleaseMode ? Level.warning : Level.verbose;
|
|
||||||
|
|
||||||
if (PlatformInfos.isMobile) {
|
if (PlatformInfos.isMobile) {
|
||||||
BackgroundPush.clientOnly(clients.first);
|
BackgroundPush.clientOnly(clients.first);
|
||||||
|
@ -99,6 +99,7 @@ abstract class ClientManager {
|
|||||||
// To check which story room we can post in
|
// To check which story room we can post in
|
||||||
EventTypes.RoomPowerLevels,
|
EventTypes.RoomPowerLevels,
|
||||||
},
|
},
|
||||||
|
logLevel: kReleaseMode ? Level.warning : Level.verbose,
|
||||||
databaseBuilder: FlutterHiveCollectionsDatabase.databaseBuilder,
|
databaseBuilder: FlutterHiveCollectionsDatabase.databaseBuilder,
|
||||||
legacyDatabaseBuilder: FlutterFluffyBoxDatabase.databaseBuilder,
|
legacyDatabaseBuilder: FlutterFluffyBoxDatabase.databaseBuilder,
|
||||||
supportedLoginTypes: {
|
supportedLoginTypes: {
|
||||||
|
@ -51,9 +51,12 @@ Future<void> pushHelper(
|
|||||||
|
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
Logs().v('Notification is a clearing indicator.');
|
Logs().v('Notification is a clearing indicator.');
|
||||||
|
if (notification.counts == null || notification.counts?.unread == 0) {
|
||||||
await _flutterLocalNotificationsPlugin.cancelAll();
|
await _flutterLocalNotificationsPlugin.cancelAll();
|
||||||
final store = await SharedPreferences.getInstance();
|
final store = await SharedPreferences.getInstance();
|
||||||
await store.setString(SettingKeys.notificationCurrentIds, json.encode({}));
|
await store.setString(
|
||||||
|
SettingKeys.notificationCurrentIds, json.encode({}));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Logs().v('Push helper got notification event.');
|
Logs().v('Push helper got notification event.');
|
||||||
|
Loading…
Reference in New Issue
Block a user