Skip to content

Commit

Permalink
refactor[UP]: refactor pushHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
baltevl committed Nov 2, 2024
1 parent 01e0724 commit a9ed453
Show file tree
Hide file tree
Showing 2 changed files with 317 additions and 310 deletions.
8 changes: 4 additions & 4 deletions lib/utils/background_push.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class BackgroundPush {
);
Logs().v('Flutter Local Notifications initialized');
firebase?.setListeners(
onMessage: (message) => pushHelper(
onMessage: (message) => PushHelper.pushHelper(
PushNotification.fromJson(
Map<String, dynamic>.from(message['data'] ?? message),
),
Expand Down Expand Up @@ -260,7 +260,7 @@ class BackgroundPush {
if (endpoint != null) {
matrix!.store.setString(
clients.first.clientName + SettingKeys.unifiedPushEndpoint,
endpoint);
endpoint,);
matrix!.store.remove(SettingKeys.unifiedPushEndpoint);
}

Expand All @@ -269,7 +269,7 @@ class BackgroundPush {
if (registered != null) {
matrix!.store.setBool(
clients.first.clientName + SettingKeys.unifiedPushRegistered,
registered);
registered,);
matrix!.store.remove(SettingKeys.unifiedPushRegistered);
}
}
Expand Down Expand Up @@ -477,7 +477,7 @@ class BackgroundPush {
);
// UP may strip the devices list
data['devices'] ??= [];
await pushHelper(
await PushHelper.pushHelper(
PushNotification.fromJson(data),
clients: clients,
instance: instance,
Expand Down
Loading

0 comments on commit a9ed453

Please sign in to comment.