clean up pushes

This commit is contained in:
or-else
2022-03-05 20:09:02 -08:00
parent 9d8a1fdfc4
commit 9c2d3f3693
6 changed files with 19 additions and 12 deletions
+3 -2
View File
@@ -316,7 +316,8 @@ class TinodeWeb extends React.Component {
}
// Tinode received a push notification from the server.
handlePushMessage(data) {
handlePushMessage(payload) {
const data = payload.data || {};
switch (data.what) {
case 'msg':
if (Tinode.isChannelTopicName(data.topic)) {
@@ -367,7 +368,7 @@ class TinodeWeb extends React.Component {
// Handhe FCM pushes
// (a) for channels always,
// (b) pushes when the app is in foreground but has no focus.
firebaseOnMessage(this.fcm, (payload) => { this.handlePushMessage(payload.data); });
firebaseOnMessage(this.fcm, (payload) => { this.handlePushMessage(payload); });
}).catch((err) => {
// SW registration or FCM has failed :(
onError(err);