fix: Clearing push triggered when only one room got seen

This commit is contained in:
Christian Pauly 2022-07-29 12:49:26 +02:00 committed by Krille Fear
parent dfd9106e56
commit fe2aea6d3c
3 changed files with 7 additions and 4 deletions

View File

@ -38,7 +38,6 @@ void main() async {
);
final clients = await ClientManager.getClients();
Logs().level = kReleaseMode ? Level.warning : Level.verbose;
if (PlatformInfos.isMobile) {
BackgroundPush.clientOnly(clients.first);

View File

@ -99,6 +99,7 @@ abstract class ClientManager {
// To check which story room we can post in
EventTypes.RoomPowerLevels,
},
logLevel: kReleaseMode ? Level.warning : Level.verbose,
databaseBuilder: FlutterHiveCollectionsDatabase.databaseBuilder,
legacyDatabaseBuilder: FlutterFluffyBoxDatabase.databaseBuilder,
supportedLoginTypes: {

View File

@ -51,9 +51,12 @@ Future<void> pushHelper(
if (event == null) {
Logs().v('Notification is a clearing indicator.');
await _flutterLocalNotificationsPlugin.cancelAll();
final store = await SharedPreferences.getInstance();
await store.setString(SettingKeys.notificationCurrentIds, json.encode({}));
if (notification.counts == null || notification.counts?.unread == 0) {
await _flutterLocalNotificationsPlugin.cancelAll();
final store = await SharedPreferences.getInstance();
await store.setString(
SettingKeys.notificationCurrentIds, json.encode({}));
}
return;
}
Logs().v('Push helper got notification event.');